Changeset 3b0bc16 for src/ControlStruct/MultiLevelExit.cpp
- Timestamp:
- Feb 1, 2022, 8:22:12 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- fde0a58
- Parents:
- 729c991
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MultiLevelExit.cpp
r729c991 r3b0bc16 10 10 // Created On : Mon Nov 1 13:48:00 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 31 22:35:08202213 // Update Count : 2 812 // Last Modified On : Tue Feb 1 18:48:47 2022 13 // Update Count : 29 14 14 // 15 15 … … 40 40 41 41 enum Kind { 42 ForStmtK, While StmtK, CompoundStmtK, IfStmtK, CaseStmtK, SwitchStmtK, TryStmtK42 ForStmtK, WhileDoStmtK, CompoundStmtK, IfStmtK, CaseStmtK, SwitchStmtK, TryStmtK 43 43 } kind; 44 44 … … 53 53 Entry( const ForStmt * stmt, Label breakExit, Label contExit ) : 54 54 stmt( stmt ), firstTarget( breakExit ), secondTarget( contExit ), kind( ForStmtK ) {} 55 Entry( const While Stmt * stmt, Label breakExit, Label contExit ) :56 stmt( stmt ), firstTarget( breakExit ), secondTarget( contExit ), kind( While StmtK ) {}55 Entry( const WhileDoStmt * stmt, Label breakExit, Label contExit ) : 56 stmt( stmt ), firstTarget( breakExit ), secondTarget( contExit ), kind( WhileDoStmtK ) {} 57 57 Entry( const CompoundStmt *stmt, Label breakExit ) : 58 58 stmt( stmt ), firstTarget( breakExit ), secondTarget(), kind( CompoundStmtK ) {} … … 66 66 stmt( stmt ), firstTarget( breakExit ), secondTarget(), kind( TryStmtK ) {} 67 67 68 bool isContTarget() const { return kind <= While StmtK; }68 bool isContTarget() const { return kind <= WhileDoStmtK; } 69 69 bool isBreakTarget() const { return kind != CaseStmtK; } 70 70 bool isFallTarget() const { return kind == CaseStmtK; } … … 72 72 73 73 // These routines set a target as being "used" by a BranchStmt 74 Label useContExit() { assert( kind <= While StmtK ); return useTarget(secondTarget); }74 Label useContExit() { assert( kind <= WhileDoStmtK ); return useTarget(secondTarget); } 75 75 Label useBreakExit() { assert( kind != CaseStmtK ); return useTarget(firstTarget); } 76 76 Label useFallExit() { assert( kind == CaseStmtK ); return useTarget(firstTarget); } … … 78 78 79 79 // These routines check if a specific label for a statement is used by a BranchStmt 80 bool isContUsed() const { assert( kind <= While StmtK ); return secondTarget.used; }80 bool isContUsed() const { assert( kind <= WhileDoStmtK ); return secondTarget.used; } 81 81 bool isBreakUsed() const { assert( kind != CaseStmtK ); return firstTarget.used; } 82 82 bool isFallUsed() const { assert( kind == CaseStmtK ); return firstTarget.used; } … … 112 112 const CompoundStmt * previsit( const CompoundStmt * ); 113 113 const BranchStmt * postvisit( const BranchStmt * ); 114 void previsit( const While Stmt * );115 const While Stmt * postvisit( const WhileStmt * );114 void previsit( const WhileDoStmt * ); 115 const WhileDoStmt * postvisit( const WhileDoStmt * ); 116 116 void previsit( const ForStmt * ); 117 117 const ForStmt * postvisit( const ForStmt * ); … … 342 342 } 343 343 344 void MultiLevelExitCore::previsit( const While Stmt * stmt ) {344 void MultiLevelExitCore::previsit( const WhileDoStmt * stmt ) { 345 345 return prehandleLoopStmt( stmt ); 346 346 } 347 347 348 const While Stmt * MultiLevelExitCore::postvisit( const WhileStmt * stmt ) {348 const WhileDoStmt * MultiLevelExitCore::postvisit( const WhileDoStmt * stmt ) { 349 349 return posthandleLoopStmt( stmt ); 350 350 }
Note: See TracChangeset
for help on using the changeset viewer.