- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/ControlStruct/ForExprMutator.cc
rd4778a6 rc11e31c 5 5 namespace ControlStruct { 6 6 Statement *ForExprMutator::mutate( ForStmt *forStmt ) { 7 // recurse down all nest for loops to hoist any initializer declarations to make them C89 (rather than C99) 7 8 forStmt->set_body( forStmt->get_body()->acceptMutator( *this ) ); 8 9 if ( DeclStmt *decl = dynamic_cast< DeclStmt * > ( forStmt->get_initialization() ) ) { 9 // create compound statement, move declaration outside, leave _for_ as-is10 // create compound statement, move initializer declaration outside, leave _for_ as-is 10 11 CompoundStmt *block = new CompoundStmt( std::list< Label >() ); 11 12 std::list<Statement *> &stmts = block->get_kids(); … … 17 18 return block; 18 19 } // if 19 // ForStmt still needs to be fixed 20 else 21 return forStmt; 20 21 return forStmt; 22 22 } 23 23 } // namespace ControlStruct
Note:
See TracChangeset
for help on using the changeset viewer.