Changeset 27de955 for src/ControlStruct/MLEMutator.h
- Timestamp:
- Jun 3, 2015, 3:19:29 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:
- 4162aea9
- Parents:
- 954463b8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MLEMutator.h
r954463b8 r27de955 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Tue May 26 15:04:21201513 // Update Count : 712 // Last Modified On : Wed Jun 03 15:06:36 2015 13 // Update Count : 25 14 14 // 15 15 … … 38 38 Statement *mutate( BranchStmt *branchStmt ) throw ( SemanticError ); 39 39 40 Statement *mutate( CaseStmt *caseStmt ); 40 41 Statement *mutate( SwitchStmt *switchStmt ); 41 42 Statement *mutate( ChooseStmt *switchStmt ); … … 48 49 class Entry { 49 50 public: 50 explicit Entry( Statement *_loop = 0, Label _contExit = Label(""), Label _breakExit = Label("") ) :51 loop( _loop ), contExit( _contExit ), breakExit( _breakExit ), contExitUsed( false ), breakExitUsed( false) {}51 explicit Entry( Statement *_loop, Label _breakExit, Label _contExit = Label("") ) : 52 loop( _loop ), breakExit( _breakExit ), contExit( _contExit ), breakUsed(false), contUsed(false) {} 52 53 53 54 bool operator==( const Statement *stmt ) { return ( loop == stmt ); } … … 58 59 Statement *get_loop() const { return loop; } 59 60 60 Label get_contExit() const {return contExit; }61 void set_contExit( Label );61 Label useContExit() { contUsed = true; return contExit; } 62 Label useBreakExit() { breakUsed = true; return breakExit; } 62 63 63 Label get_breakExit() const { return breakExit; }64 void set_breakExit( Label );64 bool isContUsed() const { return contUsed; } 65 bool isBreakUsed() const { return breakUsed; } 65 66 66 67 private: 67 68 Statement *loop; 68 Label contExit, breakExit; 69 public: // hack, provide proper [sg]etters 70 bool contExitUsed, breakExitUsed; 69 Label breakExit, contExit; 70 bool breakUsed, contUsed; 71 71 }; 72 72 … … 76 76 LabelGenerator *generator; 77 77 78 template< typename LoopClass > 79 Statement *handleLoopStmt( LoopClass *loopStmt ); 80 78 81 template< typename SwitchClass > 79 friend Statement *handleSwitchStmt( SwitchClass *switchStmt, MLEMutator &mutator ); 82 Statement *handleSwitchStmt( SwitchClass *switchStmt ); 83 84 void fixBlock( std::list< Statement * > &kids ); 80 85 }; 81 86 } // namespace ControlStruct
Note: See TracChangeset
for help on using the changeset viewer.