Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/ExceptTranslate.cc

    rc0b9f5d rba3706f  
    211211                        ThrowStmt *throwStmt ) {
    212212                // __throw_terminate( `throwStmt->get_name()` ); }
    213                 return create_given_throw( "__cfaabi_ehm__throw_terminate", throwStmt );
     213                return create_given_throw( "__cfaehm__throw_terminate", throwStmt );
    214214        }
    215215
     
    232232                        ) ) );
    233233                result->push_back( new ExprStmt(
    234                         new UntypedExpr( new NameExpr( "__cfaabi_ehm__rethrow_terminate" ) )
     234                        new UntypedExpr( new NameExpr( "__cfaehm__rethrow_terminate" ) )
    235235                        ) );
    236236                delete throwStmt;
     
    241241                        ThrowStmt *throwStmt ) {
    242242                // __throw_resume( `throwStmt->get_name` );
    243                 return create_given_throw( "__cfaabi_ehm__throw_resume", throwStmt );
     243                return create_given_throw( "__cfaehm__throw_resume", throwStmt );
    244244        }
    245245
     
    309309                        local_except->get_attributes().push_back( new Attribute(
    310310                                "cleanup",
    311                                 { new NameExpr( "__cfaabi_ehm__cleanup_terminate" ) }
     311                                { new NameExpr( "__cfaehm__cleanup_terminate" ) }
    312312                                ) );
    313313
     
    316316                                VarExprReplacer::DeclMap mapping;
    317317                                mapping[ handler_decl ] = local_except;
    318                                 VarExprReplacer::replace( handler->body, mapping );
     318                                VarExprReplacer mapper( mapping );
     319                                handler->get_body()->accept( mapper );
    319320                        }
    320321
     
    429430                        FunctionDecl * terminate_catch,
    430431                        FunctionDecl * terminate_match ) {
    431                 // { __cfaabi_ehm__try_terminate(`try`, `catch`, `match`); }
     432                // { __cfaehm__try_terminate(`try`, `catch`, `match`); }
    432433
    433434                UntypedExpr * caller = new UntypedExpr( new NameExpr(
    434                         "__cfaabi_ehm__try_terminate" ) );
     435                        "__cfaehm__try_terminate" ) );
    435436                std::list<Expression *>& args = caller->get_args();
    436437                args.push_back( nameOf( try_wrapper ) );
     
    486487
    487488                // struct __try_resume_node __resume_node
    488                 //      __attribute__((cleanup( __cfaabi_ehm__try_resume_cleanup )));
     489                //      __attribute__((cleanup( __cfaehm__try_resume_cleanup )));
    489490                // ** unwinding of the stack here could cause problems **
    490491                // ** however I don't think that can happen currently **
    491                 // __cfaabi_ehm__try_resume_setup( &__resume_node, resume_handler );
     492                // __cfaehm__try_resume_setup( &__resume_node, resume_handler );
    492493
    493494                std::list< Attribute * > attributes;
     
    495496                        std::list< Expression * > attr_params;
    496497                        attr_params.push_back( new NameExpr(
    497                                 "__cfaabi_ehm__try_resume_cleanup" ) );
     498                                "__cfaehm__try_resume_cleanup" ) );
    498499                        attributes.push_back( new Attribute( "cleanup", attr_params ) );
    499500                }
     
    514515
    515516                UntypedExpr *setup = new UntypedExpr( new NameExpr(
    516                         "__cfaabi_ehm__try_resume_setup" ) );
     517                        "__cfaehm__try_resume_setup" ) );
    517518                setup->get_args().push_back( new AddressExpr( nameOf( obj ) ) );
    518519                setup->get_args().push_back( nameOf( resume_handler ) );
     
    539540        ObjectDecl * ExceptionMutatorCore::create_finally_hook(
    540541                        FunctionDecl * finally_wrapper ) {
    541                 // struct __cfaabi_ehm__cleanup_hook __finally_hook
     542                // struct __cfaehm__cleanup_hook __finally_hook
    542543                //      __attribute__((cleanup( finally_wrapper )));
    543544
     
    593594                        // Skip children?
    594595                        return;
    595                 } else if ( structDecl->get_name() == "__cfaabi_ehm__base_exception_t" ) {
     596                } else if ( structDecl->get_name() == "__cfaehm__base_exception_t" ) {
    596597                        assert( nullptr == except_decl );
    597598                        except_decl = structDecl;
    598599                        init_func_types();
    599                 } else if ( structDecl->get_name() == "__cfaabi_ehm__try_resume_node" ) {
     600                } else if ( structDecl->get_name() == "__cfaehm__try_resume_node" ) {
    600601                        assert( nullptr == node_decl );
    601602                        node_decl = structDecl;
    602                 } else if ( structDecl->get_name() == "__cfaabi_ehm__cleanup_hook" ) {
     603                } else if ( structDecl->get_name() == "__cfaehm__cleanup_hook" ) {
    603604                        assert( nullptr == hook_decl );
    604605                        hook_decl = structDecl;
Note: See TracChangeset for help on using the changeset viewer.