Ignore:
Timestamp:
Aug 10, 2016, 2:36:17 PM (8 years ago)
Author:
Thierry Delisle <tdelisle@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/ScrubTyVars.cc

    re109716 ref42e764  
    4545
    4646        Type * ScrubTyVars::mutateAggregateType( Type *ty ) {
    47                 if ( isPolyType( ty, tyVars ) ) {
     47                if ( shouldScrub( ty ) ) {
    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 *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 ) ) );
    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 *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 ) ) );
    7777                        return expr;
    7878                } else {
     
    8282
    8383        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 );
    8699                        ret->get_qualifiers() += pointer->get_qualifiers();
    87100                        pointer->set_base( 0 );
Note: See TracChangeset for help on using the changeset viewer.