Ignore:
Timestamp:
Nov 8, 2017, 5:43:33 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
954908d
Parents:
78315272 (diff), e35f30a (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/SynTree/TypeSubstitution.cc

    r78315272 r3f7e12cb  
    148148template< typename TypeClass >
    149149Type *TypeSubstitution::handleType( TypeClass *type ) {
    150         BoundVarsType oldBoundVars( boundVars );
     150        ValueGuard<BoundVarsType> oldBoundVars( boundVars );
    151151        // bind type variables from forall-qualifiers
    152152        if ( freeOnly ) {
     
    156156        } // if
    157157        Type *ret = Mutator::mutate( type );
    158         boundVars = oldBoundVars;
    159158        return ret;
    160159}
     
    162161template< typename TypeClass >
    163162Type *TypeSubstitution::handleAggregateType( TypeClass *type ) {
    164         BoundVarsType oldBoundVars( boundVars );
     163        ValueGuard<BoundVarsType> oldBoundVars( boundVars );
    165164        // bind type variables from forall-qualifiers
    166165        if ( freeOnly ) {
     
    177176        } // if
    178177        Type *ret = Mutator::mutate( type );
    179         boundVars = oldBoundVars;
    180178        return ret;
    181179}
     
    233231}
    234232
    235 TypeSubstitution * TypeSubstitution::acceptMutator( Mutator & mutator ) {
    236         for ( auto & p : typeEnv ) {
    237                 p.second = maybeMutate( p.second, mutator );
    238         }
    239         for ( auto & p : varEnv ) {
    240                 p.second = maybeMutate( p.second, mutator );
    241         }
    242         return this;
    243 }
    244 
    245 void TypeSubstitution::print( std::ostream &os, int indent ) const {
    246         os << std::string( indent, ' ' ) << "Types:" << std::endl;
     233void TypeSubstitution::print( std::ostream &os, Indenter indent ) const {
     234        os << indent << "Types:" << std::endl;
    247235        for ( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
    248                 os << std::string( indent+2, ' ' ) << i->first << " -> ";
    249                 i->second->print( os, indent+4 );
     236                os << indent+1 << i->first << " -> ";
     237                i->second->print( os, indent+2 );
    250238                os << std::endl;
    251239        } // for
    252         os << std::string( indent, ' ' ) << "Non-types:" << std::endl;
     240        os << indent << "Non-types:" << std::endl;
    253241        for ( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
    254                 os << std::string( indent+2, ' ' ) << i->first << " -> ";
    255                 i->second->print( os, indent+4 );
     242                os << indent+1 << i->first << " -> ";
     243                i->second->print( os, indent+2 );
    256244                os << std::endl;
    257245        } // for
Note: See TracChangeset for help on using the changeset viewer.