Changeset d939274 for src/ControlStruct/MLEMutator.cc
- Timestamp:
- Jun 2, 2015, 1:59:11 PM (10 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:
- 4eb1db6
- Parents:
- b2152e7a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MLEMutator.cc
rb2152e7a rd939274 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue Jun 02 13: 35:49201513 // Update Count : 9 112 // Last Modified On : Tue Jun 02 13:43:01 2015 13 // Update Count : 92 14 14 // 15 15 … … 33 33 } // if 34 34 35 // a child statement may set the break label 36 // - if they do, attach it to the next statement 35 37 std::list< Statement * > &kids = cmpndStmt->get_kids(); 36 38 for ( std::list< Statement * >::iterator k = kids.begin(); k != kids.end(); k++ ) { … … 38 40 39 41 if ( ! get_breakLabel().empty() ) { 40 std::list< Statement * >::iterator next = k ; next++;42 std::list< Statement * >::iterator next = k+1; 41 43 if ( next == kids.end() ) { 42 44 std::list<Label> ls; ls.push_back( get_breakLabel() ); … … 58 60 } // if 59 61 60 //mutateAll( cmpndStmt->get_kids(), *this );61 62 return cmpndStmt; 62 63 } … … 76 77 Statement *MLEMutator::mutate( ForStmt *forStmt ) { 77 78 enclosingLoops.push_back( Entry( forStmt ) ); 78 maybeMutate( forStmt->get_body(), *this);79 forStmt->set_body( maybeMutate( forStmt->get_body(), *this ) ); 79 80 80 81 Entry &e = enclosingLoops.back(); … … 185 186 186 187 Statement *MLEMutator::mutateLoop( Statement *bodyLoop, Entry &e ) { 188 // ensure loop body is a block 187 189 CompoundStmt *newBody; 188 190 if ( ! (newBody = dynamic_cast<CompoundStmt *>( bodyLoop )) ) { … … 216 218 } 217 219 218 //*** Entry's methods 220 //*** Entry's methods - ensure these labels can be set at most once 219 221 void MLEMutator::Entry::set_contExit( Label l ) { 220 222 assert ( contExit == "" || contExit == l );
Note: See TracChangeset
for help on using the changeset viewer.