Changeset 3b0bc16 for src/ResolvExpr
- 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/ResolvExpr/Resolver.cc
r729c991 r3b0bc16 9 9 // Author : Aaron B. Moss 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Fri Mar 27 11:58:00 202013 // Update Count : 24 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Feb 1 16:27:14 2022 13 // Update Count : 245 14 14 // 15 15 … … 80 80 void previsit( AsmStmt * asmStmt ); 81 81 void previsit( IfStmt * ifStmt ); 82 void previsit( While Stmt * whileStmt );82 void previsit( WhileDoStmt * whileDoStmt ); 83 83 void previsit( ForStmt * forStmt ); 84 84 void previsit( SwitchStmt * switchStmt ); … … 502 502 } 503 503 504 void Resolver_old::previsit( While Stmt * whileStmt ) {505 findIntegralExpression( while Stmt->condition, indexer );504 void Resolver_old::previsit( WhileDoStmt * whileDoStmt ) { 505 findIntegralExpression( whileDoStmt->condition, indexer ); 506 506 } 507 507 … … 572 572 573 573 void Resolver_old::previsit( CatchStmt * catchStmt ) { 574 // Until we are very sure this invarent (ifs that move between passes have then Part)574 // Until we are very sure this invarent (ifs that move between passes have then) 575 575 // holds, check it. This allows a check for when to decode the mangling. 576 576 if ( IfStmt * ifStmt = dynamic_cast<IfStmt *>( catchStmt->body ) ) { 577 assert( ifStmt->then Part);577 assert( ifStmt->then ); 578 578 } 579 579 // Encode the catchStmt so the condition can see the declaration. … … 588 588 // Decode the catchStmt so everything is stored properly. 589 589 IfStmt * ifStmt = dynamic_cast<IfStmt *>( catchStmt->body ); 590 if ( nullptr != ifStmt && nullptr == ifStmt->then Part) {590 if ( nullptr != ifStmt && nullptr == ifStmt->then ) { 591 591 assert( ifStmt->condition ); 592 assert( ifStmt->else Part);592 assert( ifStmt->else_ ); 593 593 catchStmt->cond = ifStmt->condition; 594 catchStmt->body = ifStmt->else Part;594 catchStmt->body = ifStmt->else_; 595 595 ifStmt->condition = nullptr; 596 ifStmt->else Part= nullptr;596 ifStmt->else_ = nullptr; 597 597 delete ifStmt; 598 598 } … … 1272 1272 const ast::AsmStmt * previsit( const ast::AsmStmt * ); 1273 1273 const ast::IfStmt * previsit( const ast::IfStmt * ); 1274 const ast::While Stmt * previsit( const ast::WhileStmt * );1274 const ast::WhileDoStmt * previsit( const ast::WhileDoStmt * ); 1275 1275 const ast::ForStmt * previsit( const ast::ForStmt * ); 1276 1276 const ast::SwitchStmt * previsit( const ast::SwitchStmt * ); … … 1581 1581 } 1582 1582 1583 const ast::While Stmt * Resolver_new::previsit( const ast::WhileStmt * whileStmt ) {1583 const ast::WhileDoStmt * Resolver_new::previsit( const ast::WhileDoStmt * whileDoStmt ) { 1584 1584 return ast::mutate_field( 1585 while Stmt, &ast::WhileStmt::cond, findIntegralExpression( whileStmt->cond, symtab ) );1585 whileDoStmt, &ast::WhileDoStmt::cond, findIntegralExpression( whileDoStmt->cond, symtab ) ); 1586 1586 } 1587 1587 … … 1669 1669 1670 1670 const ast::CatchStmt * Resolver_new::previsit( const ast::CatchStmt * catchStmt ) { 1671 // Until we are very sure this invarent (ifs that move between passes have then Part)1671 // Until we are very sure this invarent (ifs that move between passes have then) 1672 1672 // holds, check it. This allows a check for when to decode the mangling. 1673 1673 if ( auto ifStmt = catchStmt->body.as<ast::IfStmt>() ) { 1674 assert( ifStmt->then Part);1674 assert( ifStmt->then ); 1675 1675 } 1676 1676 // Encode the catchStmt so the condition can see the declaration. … … 1687 1687 // Decode the catchStmt so everything is stored properly. 1688 1688 const ast::IfStmt * ifStmt = catchStmt->body.as<ast::IfStmt>(); 1689 if ( nullptr != ifStmt && nullptr == ifStmt->then Part) {1689 if ( nullptr != ifStmt && nullptr == ifStmt->then ) { 1690 1690 assert( ifStmt->cond ); 1691 assert( ifStmt->else Part);1691 assert( ifStmt->else_ ); 1692 1692 ast::CatchStmt * stmt = ast::mutate( catchStmt ); 1693 1693 stmt->cond = ifStmt->cond; 1694 stmt->body = ifStmt->else Part;1694 stmt->body = ifStmt->else_; 1695 1695 // ifStmt should be implicately deleted here. 1696 1696 return stmt;
Note: See TracChangeset
for help on using the changeset viewer.