Changeset 90152a4 for src/GenPoly/InstantiateGeneric.cc
- Timestamp:
- Aug 27, 2018, 4:40:34 PM (7 years ago)
- 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. - File:
-
- 1 edited
-
src/GenPoly/InstantiateGeneric.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/InstantiateGeneric.cc
rf9feab8 r90152a4 24 24 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 25 25 #include "Common/ScopedMap.h" // for ScopedMap 26 #include "Common/SemanticError.h" // for SemanticError27 26 #include "Common/UniqueName.h" // for UniqueName 28 27 #include "Common/utility.h" // for deleteAll, cloneAll … … 476 475 DeclarationWithType * field = strict_dynamic_cast< DeclarationWithType * >( member ); 477 476 MemberExpr * ret = new MemberExpr( field, memberExpr->aggregate->clone() ); 477 ResolvExpr::adjustExprType( ret->result ); // pointer decay 478 478 std::swap( ret->env, memberExpr->env ); 479 479 delete memberExpr; … … 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.