Changeset 4a40fca7
- Timestamp:
- Sep 6, 2023, 12:15:17 PM (15 months ago)
- Branches:
- master
- Children:
- cb0bcf1, f3f009f
- Parents:
- 92d8cda
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MultiLevelExit.cpp
r92d8cda r4a40fca7 10 10 // Created On : Mon Nov 1 13:48:00 2021 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Mar 28 9:42:00 202213 // Update Count : 3 412 // Last Modified On : Wed Sep 6 12:00:00 2023 13 // Update Count : 35 14 14 // 15 15 … … 18 18 #include "AST/Pass.hpp" 19 19 #include "AST/Stmt.hpp" 20 #include "Common/CodeLocationTools.hpp"21 20 #include "LabelGeneratorNew.hpp" 22 21 … … 26 25 27 26 namespace ControlStruct { 27 28 namespace { 29 28 30 class Entry { 29 31 public: … … 35 37 bool used = false; 36 38 Target( const Label & label ) : label( label ) {} 37 Target() : label( CodeLocation() ) {}39 Target() : label( CodeLocation(), "" ) {} 38 40 }; 39 41 Target firstTarget; … … 524 526 // if continue is used insert a continue label into the back of the body of the loop 525 527 if ( entry.isContUsed() ) { 526 CompoundStmt * new_body = new CompoundStmt( body->location );527 // {}528 new_body->kids.push_back( body );529 528 // { 530 529 // body 530 // ContinueLabel: ; 531 531 // } 532 new_body->kids.push_back( 533 labelledNullStmt( body->location, entry.useContExit() ) ); 534 // { 535 // body 536 // ContinueLabel: {} 537 // } 538 return new_body; 532 return new CompoundStmt( body->location, { 533 body, 534 labelledNullStmt( body->location, entry.useContExit() ), 535 } ); 539 536 } 540 537 … … 620 617 } 621 618 619 } // namespace 620 622 621 const CompoundStmt * multiLevelExitUpdate( 623 const CompoundStmt * stmt, 624 const LabelToStmt & labelTable ) { 622 const CompoundStmt * stmt, const LabelToStmt & labelTable ) { 625 623 // Must start in the body, so FunctionDecls can be a stopping point. 626 624 Pass<MultiLevelExitCore> visitor( labelTable ); 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 } 625 return stmt->accept( visitor ); 626 } 627 632 628 } // namespace ControlStruct 633 629
Note: See TracChangeset
for help on using the changeset viewer.