Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/ScrubTyVars.cc

    r3bb195cb radc6781  
    4545
    4646        Type * ScrubTyVars::mutateAggregateType( Type *ty ) {
    47                 if ( shouldScrub( ty ) ) {
     47                if ( isPolyType( ty, tyVars ) ) {
    4848                        PointerType *ret = new PointerType( Type::Qualifiers(), new VoidType( ty->get_qualifiers() ) );
    4949                        delete ty;
     
    6363        Expression * ScrubTyVars::mutate( SizeofExpr *szeof ) {
    6464                // sizeof( T ) => _sizeof_T parameter, which is the size of T
    65                 if ( Type *dynType = shouldScrub( szeof->get_type() ) ) {
    66                         Expression *expr = new NameExpr( sizeofName( mangleType( dynType ) ) );
     65                if ( Type *polyType = isPolyType( szeof->get_type() ) ) {
     66                        Expression *expr = new NameExpr( sizeofName( mangleType( polyType ) ) );
    6767                        return expr;
    6868                } else {
     
    7373        Expression * ScrubTyVars::mutate( AlignofExpr *algnof ) {
    7474                // alignof( T ) => _alignof_T parameter, which is the alignment of T
    75                 if ( Type *dynType = shouldScrub( algnof->get_type() ) ) {
    76                         Expression *expr = new NameExpr( alignofName( mangleType( dynType ) ) );
     75                if ( Type *polyType = isPolyType( algnof->get_type() ) ) {
     76                        Expression *expr = new NameExpr( alignofName( mangleType( polyType ) ) );
    7777                        return expr;
    7878                } else {
     
    8282
    8383        Type * ScrubTyVars::mutate( PointerType *pointer ) {
    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 );
     84                if ( Type *polyType = isPolyType( pointer->get_base(), tyVars ) ) {
     85                        Type *ret = polyType->acceptMutator( *this );
    9986                        ret->get_qualifiers() += pointer->get_qualifiers();
    10087                        pointer->set_base( 0 );
Note: See TracChangeset for help on using the changeset viewer.