Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r3090127 r665f432  
    99// Author           : Aaron B. Moss
    1010// Created On       : Sun May 17 12:17:01 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Fri Mar 27 11:58:00 2020
    13 // Update Count     : 242
     11// Last Modified By : Aaron B. Moss
     12// Last Modified On : Wed May 29 11:00:00 2019
     13// Update Count     : 241
    1414//
    1515
     
    8484                void previsit( ThrowStmt * throwStmt );
    8585                void previsit( CatchStmt * catchStmt );
    86                 void postvisit( CatchStmt * catchStmt );
    8786                void previsit( WaitForStmt * stmt );
    8887
     
    560559                // TODO: Replace *exception type with &exception type.
    561560                if ( throwStmt->get_expr() ) {
    562                         const StructDecl * exception_decl = indexer.lookupStruct( "__cfaehm_base_exception_t" );
     561                        const StructDecl * exception_decl = indexer.lookupStruct( "__cfaabi_ehm__base_exception_t" );
    563562                        assert( exception_decl );
    564563                        Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, const_cast<StructDecl *>(exception_decl) ) );
     
    568567
    569568        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.
    576569                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 );
    594571                }
    595572        }
     
    14771454                if ( throwStmt->expr ) {
    14781455                        const ast::StructDecl * exceptionDecl =
    1479                                 symtab.lookupStruct( "__cfaehm_base_exception_t" );
     1456                                symtab.lookupStruct( "__cfaabi_ehm__base_exception_t" );
    14801457                        assert( exceptionDecl );
    14811458                        ast::ptr< ast::Type > exceptType =
     
    14891466
    14901467        const ast::CatchStmt * Resolver_new::previsit( const ast::CatchStmt * catchStmt ) {
    1491                 // TODO: This will need a fix for the decl/cond scoping problem.
    14921468                if ( catchStmt->cond ) {
    14931469                        ast::ptr< ast::Type > boolType = new ast::BasicType{ ast::BasicType::Bool };
Note: See TracChangeset for help on using the changeset viewer.