Changes in src/ResolvExpr/Resolver.cc [3b9c674:8fd52e90]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r3b9c674 r8fd52e90 84 84 void previsit( ThrowStmt * throwStmt ); 85 85 void previsit( CatchStmt * catchStmt ); 86 void postvisit( CatchStmt * catchStmt );87 86 void previsit( WaitForStmt * stmt ); 88 87 … … 486 485 visit_children = false; 487 486 findVoidExpression( asmExpr->operand, indexer ); 487 if ( asmExpr->get_inout() ) { 488 findVoidExpression( asmExpr->inout, indexer ); 489 } // if 488 490 } 489 491 … … 568 570 569 571 void Resolver_old::previsit( CatchStmt * catchStmt ) { 570 // Until we are very sure this invarent (ifs that move between passes have thenPart)571 // holds, check it. This allows a check for when to decode the mangling.572 if ( IfStmt * ifStmt = dynamic_cast<IfStmt *>( catchStmt->body ) ) {573 assert( ifStmt->thenPart );574 }575 // Encode the catchStmt so the condition can see the declaration.576 572 if ( catchStmt->cond ) { 577 IfStmt * ifStmt = new IfStmt( catchStmt->cond, nullptr, catchStmt->body ); 578 catchStmt->cond = nullptr; 579 catchStmt->body = ifStmt; 580 } 581 } 582 583 void Resolver_old::postvisit( CatchStmt * catchStmt ) { 584 // Decode the catchStmt so everything is stored properly. 585 IfStmt * ifStmt = dynamic_cast<IfStmt *>( catchStmt->body ); 586 if ( nullptr != ifStmt && nullptr == ifStmt->thenPart ) { 587 assert( ifStmt->condition ); 588 assert( ifStmt->elsePart ); 589 catchStmt->cond = ifStmt->condition; 590 catchStmt->body = ifStmt->elsePart; 591 ifStmt->condition = nullptr; 592 ifStmt->elsePart = nullptr; 593 delete ifStmt; 573 findSingleExpression( catchStmt->cond, new BasicType( noQualifiers, BasicType::Bool ), indexer ); 594 574 } 595 575 } … … 1386 1366 asmExpr, &ast::AsmExpr::operand, findVoidExpression( asmExpr->operand, symtab ) ); 1387 1367 1368 if ( asmExpr->inout ) { 1369 asmExpr = ast::mutate_field( 1370 asmExpr, &ast::AsmExpr::inout, findVoidExpression( asmExpr->inout, symtab ) ); 1371 } 1372 1388 1373 return asmExpr; 1389 1374 } … … 1489 1474 1490 1475 const ast::CatchStmt * Resolver_new::previsit( const ast::CatchStmt * catchStmt ) { 1491 // TODO: This will need a fix for the decl/cond scoping problem.1492 1476 if ( catchStmt->cond ) { 1493 1477 ast::ptr< ast::Type > boolType = new ast::BasicType{ ast::BasicType::Bool };
Note:
See TracChangeset
for help on using the changeset viewer.