Changes in / [cb0bcf1:9d47c1f]
- File:
-
- 1 edited
-
src/ControlStruct/MultiLevelExit.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MultiLevelExit.cpp
rcb0bcf1 r9d47c1f 10 10 // Created On : Mon Nov 1 13:48:00 2021 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Sep 6 12:00:00 202313 // Update Count : 3 512 // Last Modified On : Mon Mar 28 9:42:00 2022 13 // Update Count : 34 14 14 // 15 15 … … 18 18 #include "AST/Pass.hpp" 19 19 #include "AST/Stmt.hpp" 20 #include "Common/CodeLocationTools.hpp" 20 21 #include "LabelGeneratorNew.hpp" 21 22 … … 25 26 26 27 namespace ControlStruct { 27 28 namespace {29 30 28 class Entry { 31 29 public: … … 37 35 bool used = false; 38 36 Target( const Label & label ) : label( label ) {} 39 Target() : label( CodeLocation() , "") {}37 Target() : label( CodeLocation() ) {} 40 38 }; 41 39 Target firstTarget; … … 526 524 // if continue is used insert a continue label into the back of the body of the loop 527 525 if ( entry.isContUsed() ) { 526 CompoundStmt * new_body = new CompoundStmt( body->location ); 527 // {} 528 new_body->kids.push_back( body ); 528 529 // { 529 530 // body 530 // ContinueLabel: ;531 531 // } 532 return new CompoundStmt( body->location, { 533 body, 534 labelledNullStmt( body->location, entry.useContExit() ), 535 } ); 532 new_body->kids.push_back( 533 labelledNullStmt( body->location, entry.useContExit() ) ); 534 // { 535 // body 536 // ContinueLabel: {} 537 // } 538 return new_body; 536 539 } 537 540 … … 617 620 } 618 621 619 } // namespace620 621 622 const CompoundStmt * multiLevelExitUpdate( 622 const CompoundStmt * stmt, const LabelToStmt & labelTable ) { 623 const CompoundStmt * stmt, 624 const LabelToStmt & labelTable ) { 623 625 // Must start in the body, so FunctionDecls can be a stopping point. 624 626 Pass<MultiLevelExitCore> visitor( labelTable ); 625 return stmt->accept( visitor ); 626 } 627 627 const CompoundStmt * ret = stmt->accept( visitor ); 628 // There are some unset code locations slipping in, possibly by Labels. 629 const Node * node = localFillCodeLocations( ret->location, ret ); 630 return strict_dynamic_cast<const CompoundStmt *>( node ); 631 } 628 632 } // namespace ControlStruct 629 633
Note:
See TracChangeset
for help on using the changeset viewer.