Changeset ef42e764 for src/GenPoly/ScrubTyVars.cc
- Timestamp:
- Aug 10, 2016, 2:36:17 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 5ae36ed
- Parents:
- e109716 (diff), 3078643 (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
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/ScrubTyVars.cc
re109716 ref42e764 45 45 46 46 Type * ScrubTyVars::mutateAggregateType( Type *ty ) { 47 if ( isPolyType( ty, tyVars) ) {47 if ( shouldScrub( ty ) ) { 48 48 PointerType *ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) ); 49 49 delete ty; … … 63 63 Expression * ScrubTyVars::mutate( SizeofExpr *szeof ) { 64 64 // sizeof( T ) => _sizeof_T parameter, which is the size of T 65 if ( Type * polyType = isPolyType( szeof->get_type() ) ) {66 Expression *expr = new NameExpr( sizeofName( mangleType( polyType ) ) );65 if ( Type *dynType = shouldScrub( szeof->get_type() ) ) { 66 Expression *expr = new NameExpr( sizeofName( mangleType( dynType ) ) ); 67 67 return expr; 68 68 } else { … … 73 73 Expression * ScrubTyVars::mutate( AlignofExpr *algnof ) { 74 74 // alignof( T ) => _alignof_T parameter, which is the alignment of T 75 if ( Type * polyType = isPolyType( algnof->get_type() ) ) {76 Expression *expr = new NameExpr( alignofName( mangleType( polyType ) ) );75 if ( Type *dynType = shouldScrub( algnof->get_type() ) ) { 76 Expression *expr = new NameExpr( alignofName( mangleType( dynType ) ) ); 77 77 return expr; 78 78 } else { … … 82 82 83 83 Type * ScrubTyVars::mutate( PointerType *pointer ) { 84 if ( Type *polyType = isPolyType( pointer->get_base(), tyVars ) ) { 85 Type *ret = polyType->acceptMutator( *this ); 84 // // special case of shouldScrub that takes all TypeInstType pointer bases, even if they're not dynamic 85 // Type *base = pointer->get_base(); 86 // Type *dynType = 0; 87 // if ( dynamicOnly ) { 88 // if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( base ) ) { 89 // if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) { dynType = typeInst; } 90 // } else { 91 // dynType = isDynType( base, tyVars ); 92 // } 93 // } else { 94 // dynType = isPolyType( base, tyVars ); 95 // } 96 // if ( dynType ) { 97 if ( Type *dynType = shouldScrub( pointer->get_base() ) ) { 98 Type *ret = dynType->acceptMutator( *this ); 86 99 ret->get_qualifiers() += pointer->get_qualifiers(); 87 100 pointer->set_base( 0 );
Note: See TracChangeset
for help on using the changeset viewer.