Ignore:
Timestamp:
May 17, 2015, 1:19:35 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
0dd3a2f
Parents:
b87a5ed
Message:

licencing: second groups of files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • translator/SynTree/TypeSubstitution.cc

    rb87a5ed ra32b204  
    2121TypeSubstitution::~TypeSubstitution()
    2222{
    23     for( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
     23    for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
    2424        delete( i->second );
    2525    }
    26     for( VarEnvType::iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
     26    for ( VarEnvType::iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
    2727        delete( i->second );
    2828    }
     
    3232TypeSubstitution::operator=( const TypeSubstitution &other )
    3333{
    34     if( this == &other ) return *this;
     34    if ( this == &other ) return *this;
    3535    initialize( other, *this );
    3636    return *this;
     
    4848TypeSubstitution::add( const TypeSubstitution &other )
    4949{
    50     for( TypeEnvType::const_iterator i = other.typeEnv.begin(); i != other.typeEnv.end(); ++i ) {
     50    for ( TypeEnvType::const_iterator i = other.typeEnv.begin(); i != other.typeEnv.end(); ++i ) {
    5151        typeEnv[ i->first ] = i->second->clone();
    5252    }
    53     for( VarEnvType::const_iterator i = other.varEnv.begin(); i != other.varEnv.end(); ++i ) {
     53    for ( VarEnvType::const_iterator i = other.varEnv.begin(); i != other.varEnv.end(); ++i ) {
    5454        varEnv[ i->first ] = i->second->clone();
    5555    }
     
    6060{
    6161    TypeEnvType::iterator i = typeEnv.find( formalType );
    62     if( i != typeEnv.end() ) {
     62    if ( i != typeEnv.end() ) {
    6363        delete i->second;
    6464    }
     
    7070{
    7171    TypeEnvType::iterator i = typeEnv.find( formalType );
    72     if( i != typeEnv.end() ) {
     72    if ( i != typeEnv.end() ) {
    7373        delete i->second;
    7474        typeEnv.erase( formalType );
     
    8080{
    8181    TypeEnvType::const_iterator i = typeEnv.find( formalType );
    82     if( i == typeEnv.end() ) {
     82    if ( i == typeEnv.end() ) {
    8383        return 0;
    8484    } else {
     
    9999        subCount = 0;
    100100        freeOnly = true;
    101         for( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
     101        for ( TypeEnvType::iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
    102102            i->second = i->second->acceptMutator( *this );
    103103        }
    104     } while( subCount );
     104    } while ( subCount );
    105105}
    106106
     
    109109{
    110110    BoundVarsType::const_iterator bound = boundVars.find( inst->get_name() );
    111     if( bound != boundVars.end() ) return inst;
     111    if ( bound != boundVars.end() ) return inst;
    112112   
    113113    TypeEnvType::const_iterator i = typeEnv.find( inst->get_name() );
    114     if( i == typeEnv.end() ) {
     114    if ( i == typeEnv.end() ) {
    115115        return inst;
    116116    } else {
     
    130130{
    131131    VarEnvType::const_iterator i = varEnv.find( nameExpr->get_name() );
    132     if( i == varEnv.end() ) {
     132    if ( i == varEnv.end() ) {
    133133        return nameExpr;
    134134    } else {
     
    144144{
    145145    BoundVarsType oldBoundVars( boundVars );
    146     if( freeOnly ) {
    147         for( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
     146    if ( freeOnly ) {
     147        for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_forall().begin(); tyvar != type->get_forall().end(); ++tyvar ) {
    148148            boundVars.insert( (*tyvar)->get_name() );
    149149        }
     
    218218{
    219219    os << std::string( indent, ' ' ) << "Types:" << std::endl;
    220     for( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
     220    for ( TypeEnvType::const_iterator i = typeEnv.begin(); i != typeEnv.end(); ++i ) {
    221221        os << std::string( indent+2, ' ' ) << i->first << " -> ";
    222222        i->second->print( os, indent+4 );
     
    224224    }
    225225    os << std::string( indent, ' ' ) << "Non-types:" << std::endl;
    226     for( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
     226    for ( VarEnvType::const_iterator i = varEnv.begin(); i != varEnv.end(); ++i ) {
    227227        os << std::string( indent+2, ' ' ) << i->first << " -> ";
    228228        i->second->print( os, indent+4 );
Note: See TracChangeset for help on using the changeset viewer.