Ignore:
Timestamp:
Aug 27, 2018, 4:40:34 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b7c89aa
Parents:
f9feab8 (diff), 305581d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/InstantiateGeneric.cc

    rf9feab8 r90152a4  
    2424#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
    2525#include "Common/ScopedMap.h"          // for ScopedMap
    26 #include "Common/SemanticError.h"      // for SemanticError
    2726#include "Common/UniqueName.h"         // for UniqueName
    2827#include "Common/utility.h"            // for deleteAll, cloneAll
     
    476475                        DeclarationWithType * field = strict_dynamic_cast< DeclarationWithType * >( member );
    477476                        MemberExpr * ret = new MemberExpr( field, memberExpr->aggregate->clone() );
     477                        ResolvExpr::adjustExprType( ret->result ); // pointer decay
    478478                        std::swap( ret->env, memberExpr->env );
    479479                        delete memberExpr;
     
    496496        Expression * FixDtypeStatic::fixMemberExpr( AggrInst * inst, MemberExpr * memberExpr ) {
    497497                // need to cast dtype-static member expressions to their actual type before that type is erased.
     498                // NOTE: the casts here have the third argument (isGenerated) set to false so that these casts persist until Box, where they are needed.
    498499                auto & baseParams = *inst->get_baseParameters();
    499500                if ( isDtypeStatic( baseParams ) ) {
     
    515516                                        // Note: this currently creates more temporaries than is strictly necessary, since it does not check for duplicate uses of the same member expression.
    516517                                        static UniqueName tmpNamer( "_dtype_static_member_" );
    517                                         Expression * init = new CastExpr( new AddressExpr( memberExpr ), new PointerType( Type::Qualifiers(), concType->clone() ) );
     518                                        Expression * init = new CastExpr( new AddressExpr( memberExpr ), new PointerType( Type::Qualifiers(), concType->clone() ), false );
    518519                                        ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), new ReferenceType( Type::Qualifiers(), concType ), new SingleInit( init ) );
    519520                                        stmtsToAddBefore.push_back( new DeclStmt( tmp ) );
     
    521522                                } else {
    522523                                        // can simply add a cast to actual type
    523                                         return new CastExpr( memberExpr, concType );
     524                                        return new CastExpr( memberExpr, concType, false );
    524525                                }
    525526                        }
Note: See TracChangeset for help on using the changeset viewer.