Changes in src/ResolvExpr/Resolver.cc [3b0bc16:7583c02]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r3b0bc16 r7583c02 9 9 // Author : Aaron B. Moss 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Tue Feb 1 16:27:14 202213 // Update Count : 24 511 // Last Modified By : Andrew Beach 12 // Last Modified On : Fri Mar 27 11:58:00 2020 13 // Update Count : 242 14 14 // 15 15 … … 80 80 void previsit( AsmStmt * asmStmt ); 81 81 void previsit( IfStmt * ifStmt ); 82 void previsit( While DoStmt * whileDoStmt );82 void previsit( WhileStmt * whileStmt ); 83 83 void previsit( ForStmt * forStmt ); 84 84 void previsit( SwitchStmt * switchStmt ); … … 502 502 } 503 503 504 void Resolver_old::previsit( While DoStmt * whileDoStmt ) {505 findIntegralExpression( while DoStmt->condition, indexer );504 void Resolver_old::previsit( WhileStmt * whileStmt ) { 505 findIntegralExpression( whileStmt->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 )574 // Until we are very sure this invarent (ifs that move between passes have thenPart) 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 );577 assert( ifStmt->thenPart ); 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 ) {590 if ( nullptr != ifStmt && nullptr == ifStmt->thenPart ) { 591 591 assert( ifStmt->condition ); 592 assert( ifStmt->else _);592 assert( ifStmt->elsePart ); 593 593 catchStmt->cond = ifStmt->condition; 594 catchStmt->body = ifStmt->else _;594 catchStmt->body = ifStmt->elsePart; 595 595 ifStmt->condition = nullptr; 596 ifStmt->else _= nullptr;596 ifStmt->elsePart = 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 DoStmt * previsit( const ast::WhileDoStmt * );1274 const ast::WhileStmt * previsit( const ast::WhileStmt * ); 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 DoStmt * Resolver_new::previsit( const ast::WhileDoStmt * whileDoStmt ) {1583 const ast::WhileStmt * Resolver_new::previsit( const ast::WhileStmt * whileStmt ) { 1584 1584 return ast::mutate_field( 1585 while DoStmt, &ast::WhileDoStmt::cond, findIntegralExpression( whileDoStmt->cond, symtab ) );1585 whileStmt, &ast::WhileStmt::cond, findIntegralExpression( whileStmt->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 )1671 // Until we are very sure this invarent (ifs that move between passes have thenPart) 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 );1674 assert( ifStmt->thenPart ); 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 ) {1689 if ( nullptr != ifStmt && nullptr == ifStmt->thenPart ) { 1690 1690 assert( ifStmt->cond ); 1691 assert( ifStmt->else _);1691 assert( ifStmt->elsePart ); 1692 1692 ast::CatchStmt * stmt = ast::mutate( catchStmt ); 1693 1693 stmt->cond = ifStmt->cond; 1694 stmt->body = ifStmt->else _;1694 stmt->body = ifStmt->elsePart; 1695 1695 // ifStmt should be implicately deleted here. 1696 1696 return stmt;
Note:
See TracChangeset
for help on using the changeset viewer.