Changes in src/GenPoly/ScrubTyVars.cc [adc6781:3bb195cb]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/ScrubTyVars.cc
radc6781 r3bb195cb 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.