Changeset f75e25b for src/ControlStruct
- Timestamp:
- May 12, 2022, 3:10:22 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- e5628db
- Parents:
- 6825167
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/ControlStruct/MultiLevelExit.cpp ¶
r6825167 rf75e25b 588 588 } 589 589 590 ptr<Stmt> else_stmt = nullptr; 591 Stmt * loop_kid = nullptr; 592 // check if loop node and if so add else clause if it exists 593 const WhileDoStmt * whilePtr = dynamic_cast<const WhileDoStmt *>(kid.get()); 594 if ( whilePtr && whilePtr->else_) { 595 else_stmt = whilePtr->else_; 596 WhileDoStmt * mutate_ptr = mutate(whilePtr); 597 mutate_ptr->else_ = nullptr; 598 loop_kid = mutate_ptr; 599 } 600 const ForStmt * forPtr = dynamic_cast<const ForStmt *>(kid.get()); 601 if ( forPtr && forPtr->else_) { 602 else_stmt = forPtr->else_; 603 ForStmt * mutate_ptr = mutate(forPtr); 604 mutate_ptr->else_ = nullptr; 605 loop_kid = mutate_ptr; 606 } 607 590 608 try { 591 ret.push_back( kid->accept( *visitor ) ); 609 if (else_stmt) ret.push_back( loop_kid->accept( *visitor ) ); 610 else ret.push_back( kid->accept( *visitor ) ); 592 611 } catch ( SemanticErrorException & e ) { 593 612 errors.append( e ); 594 613 } 595 614 596 // check if loop node and if so add else clause if it exists 597 const WhileDoStmt * whilePtr = dynamic_cast<const WhileDoStmt *>(kid.get()); 598 if ( whilePtr && whilePtr->else_) ret.push_back(whilePtr->else_); 599 const ForStmt * forPtr = dynamic_cast<const ForStmt *>(kid.get()); 600 if ( forPtr && forPtr->else_) ret.push_back(forPtr->else_); 615 if (else_stmt) ret.push_back(else_stmt); 601 616 602 617 if ( ! break_label.empty() ) {
Note: See TracChangeset
for help on using the changeset viewer.