Changeset b1e63ac5 for src/ControlStruct
- Timestamp:
- Jul 4, 2017, 9:40:16 AM (9 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, stuck-waitfor-destruct, with_gc
- Children:
- 208e5be
- Parents:
- 9c951e3 (diff), f7cb0bc (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/ControlStruct
- Files:
-
- 2 added
- 4 edited
-
ExceptTranslate.cc (added)
-
ExceptTranslate.h (added)
-
ForExprMutator.cc (modified) (3 diffs)
-
ForExprMutator.h (modified) (2 diffs)
-
Mutate.cc (modified) (2 diffs)
-
module.mk (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ForExprMutator.cc
r9c951e3 rb1e63ac5 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 -
src/ControlStruct/ForExprMutator.h
r9c951e3 rb1e63ac5 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ForExprMutator.h -- 7 // ForExprMutator.h -- 8 8 // 9 9 // Author : Rodolfo G. Esteves … … 21 21 22 22 namespace ControlStruct { 23 class ForExprMutator : public Mutator{23 class ForExprMutator { 24 24 public: 25 virtual Statement *mutate( ForStmt * );25 Statement *postmutate( ForStmt * ); 26 26 }; 27 27 } // namespace ControlStruct -
src/ControlStruct/Mutate.cc
r9c951e3 rb1e63ac5 26 26 27 27 #include "Common/utility.h" 28 #include "Common/PassVisitor.h" 28 29 29 30 #include "SynTree/Visitor.h" … … 34 35 void mutate( std::list< Declaration * > translationUnit ) { 35 36 // hoist initialization out of for statements 36 ForExprMutatorformut;37 PassVisitor<ForExprMutator> formut; 37 38 38 39 // normalizes label definitions and generates multi-level exit labels -
src/ControlStruct/module.mk
r9c951e3 rb1e63ac5 10 10 ## Author : Richard C. Bilson 11 11 ## Created On : Mon Jun 1 17:49:17 2015 12 ## Last Modified By : Peter A. Buhr13 ## Last Modified On : Thu Aug 4 11:38:06 201614 ## Update Count : 312 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Wed Jun 28 16:15:00 2017 14 ## Update Count : 4 15 15 ############################################################################### 16 16 17 17 SRC += ControlStruct/LabelGenerator.cc \ 18 18 ControlStruct/LabelFixer.cc \ 19 ControlStruct/MLEMutator.cc \19 ControlStruct/MLEMutator.cc \ 20 20 ControlStruct/Mutate.cc \ 21 ControlStruct/ForExprMutator.cc 22 21 ControlStruct/ForExprMutator.cc \ 22 ControlStruct/ExceptTranslate.cc
Note:
See TracChangeset
for help on using the changeset viewer.