Changes in src/ResolvExpr/Resolver.cc [3090127:665f432]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cc
r3090127 r665f432 9 9 // Author : Aaron B. Moss 10 10 // Created On : Sun May 17 12:17:01 2015 11 // Last Modified By : A ndrew Beach12 // Last Modified On : Fri Mar 27 11:58:00 202013 // Update Count : 24 211 // Last Modified By : Aaron B. Moss 12 // Last Modified On : Wed May 29 11:00:00 2019 13 // Update Count : 241 14 14 // 15 15 … … 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 … … 560 559 // TODO: Replace *exception type with &exception type. 561 560 if ( throwStmt->get_expr() ) { 562 const StructDecl * exception_decl = indexer.lookupStruct( "__cfa ehm_base_exception_t" );561 const StructDecl * exception_decl = indexer.lookupStruct( "__cfaabi_ehm__base_exception_t" ); 563 562 assert( exception_decl ); 564 563 Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, const_cast<StructDecl *>(exception_decl) ) ); … … 568 567 569 568 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 569 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; 570 findSingleExpression( catchStmt->cond, new BasicType( noQualifiers, BasicType::Bool ), indexer ); 594 571 } 595 572 } … … 1477 1454 if ( throwStmt->expr ) { 1478 1455 const ast::StructDecl * exceptionDecl = 1479 symtab.lookupStruct( "__cfa ehm_base_exception_t" );1456 symtab.lookupStruct( "__cfaabi_ehm__base_exception_t" ); 1480 1457 assert( exceptionDecl ); 1481 1458 ast::ptr< ast::Type > exceptType = … … 1489 1466 1490 1467 const ast::CatchStmt * Resolver_new::previsit( const ast::CatchStmt * catchStmt ) { 1491 // TODO: This will need a fix for the decl/cond scoping problem.1492 1468 if ( catchStmt->cond ) { 1493 1469 ast::ptr< ast::Type > boolType = new ast::BasicType{ ast::BasicType::Bool };
Note:
See TracChangeset
for help on using the changeset viewer.