Changeset 0db6fc0 for src/ControlStruct/ForExprMutator.cc
- Timestamp:
- Jun 2, 2017, 6:30:18 PM (8 years ago)
- 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:
- 7985fa5
- Parents:
- f94ca7e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ForExprMutator.cc
rf94ca7e r0db6fc0 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ForExprMutator.cc -- 7 // ForExprMutator.cc -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 19 19 20 20 namespace ControlStruct { 21 Statement *ForExprMutator::mutate( ForStmt *forStmt ) { 22 // recurse down all nest for loops to hoist any initializer declarations to make them C89 (rather than C99) 23 forStmt->set_body( forStmt->get_body()->acceptMutator( *this ) ); 24 25 std::list<Statement *> &init = forStmt->get_initialization(); 21 Statement *ForExprMutator::postmutate( ForStmt *forStmt ) { 22 // hoist any initializer declarations to make them C89 (rather than C99) 23 std::list<Statement *> &init = forStmt->get_initialization(); 26 24 if ( init.size() == 0 ) { 27 25 return forStmt; … … 39 37 forStmt->set_initialization( std::list<Statement *>() ); 40 38 return block; 41 42 return forStmt;43 39 } 44 40 } // namespace ControlStruct
Note: See TracChangeset
for help on using the changeset viewer.