Changeset a32b204 for translator/GenPoly/PolyMutator.cc
- Timestamp:
- May 17, 2015, 1:19:35 PM (9 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/GenPoly/PolyMutator.cc
rb87a5ed ra32b204 28 28 PolyMutator::mutateStatementList( std::list< Statement* > &statements ) 29 29 { 30 for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {31 if ( !stmtsToAddAfter.empty() ) {30 for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) { 31 if ( ! stmtsToAddAfter.empty() ) { 32 32 statements.splice( i, stmtsToAddAfter ); 33 33 } 34 34 *i = (*i)->acceptMutator( *this ); 35 if ( !stmtsToAdd.empty() ) {35 if ( ! stmtsToAdd.empty() ) { 36 36 statements.splice( i, stmtsToAdd ); 37 37 } 38 38 } 39 if ( !stmtsToAddAfter.empty() ) {39 if ( ! stmtsToAddAfter.empty() ) { 40 40 statements.splice( statements.end(), stmtsToAddAfter ); 41 41 } … … 46 46 { 47 47 Statement *newStmt = maybeMutate( stmt, *this ); 48 if ( !stmtsToAdd.empty() || !stmtsToAddAfter.empty() ) {48 if ( ! stmtsToAdd.empty() || ! stmtsToAddAfter.empty() ) { 49 49 CompoundStmt *compound = new CompoundStmt( noLabels ); 50 50 compound->get_kids().splice( compound->get_kids().end(), stmtsToAdd ); … … 61 61 PolyMutator::mutateExpression( Expression *expr ) 62 62 { 63 if ( expr ) {64 if ( expr->get_env() ) {63 if ( expr ) { 64 if ( expr->get_env() ) { 65 65 env = expr->get_env(); 66 66 } … … 167 167 PolyMutator::mutate(UntypedExpr *untypedExpr) 168 168 { 169 for ( std::list< Expression* >::iterator i = untypedExpr->get_args().begin(); i != untypedExpr->get_args().end(); ++i ) {169 for ( std::list< Expression* >::iterator i = untypedExpr->get_args().begin(); i != untypedExpr->get_args().end(); ++i ) { 170 170 *i = mutateExpression( *i ); 171 171 } … … 177 177 PolyMutator::makeTyVarMap( Type *type, TyVarMap &tyVarMap ) 178 178 { 179 for ( std::list< TypeDecl* >::const_iterator tyVar = type->get_forall().begin(); tyVar != type->get_forall().end(); ++tyVar ) {179 for ( std::list< TypeDecl* >::const_iterator tyVar = type->get_forall().begin(); tyVar != type->get_forall().end(); ++tyVar ) { 180 180 assert( *tyVar ); 181 181 tyVarMap[ (*tyVar)->get_name() ] = (*tyVar)->get_kind(); 182 182 } 183 if ( PointerType *pointer = dynamic_cast< PointerType* >( type ) ) {183 if ( PointerType *pointer = dynamic_cast< PointerType* >( type ) ) { 184 184 makeTyVarMap( pointer->get_base(), tyVarMap ); 185 185 }
Note: See TracChangeset
for help on using the changeset viewer.