Changeset 27aca84
- Timestamp:
- Apr 17, 2018, 4:25:10 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 70a5acf
- Parents:
- c0bf94e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/InstantiateGeneric.cc
rc0bf94e r27aca84 496 496 Expression * FixDtypeStatic::fixMemberExpr( AggrInst * inst, MemberExpr * memberExpr ) { 497 497 // 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. 498 499 auto & baseParams = *inst->get_baseParameters(); 499 500 if ( isDtypeStatic( baseParams ) ) { … … 515 516 // Note: this currently creates more temporaries than is strictly necessary, since it does not check for duplicate uses of the same member expression. 516 517 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 ); 518 519 ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), new ReferenceType( Type::Qualifiers(), concType ), new SingleInit( init ) ); 519 520 stmtsToAddBefore.push_back( new DeclStmt( tmp ) ); … … 521 522 } else { 522 523 // can simply add a cast to actual type 523 return new CastExpr( memberExpr, concType );524 return new CastExpr( memberExpr, concType, false ); 524 525 } 525 526 }
Note: See TracChangeset
for help on using the changeset viewer.