- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
rc0b9f5d rba3706f 211 211 ThrowStmt *throwStmt ) { 212 212 // __throw_terminate( `throwStmt->get_name()` ); } 213 return create_given_throw( "__cfa abi_ehm__throw_terminate", throwStmt );213 return create_given_throw( "__cfaehm__throw_terminate", throwStmt ); 214 214 } 215 215 … … 232 232 ) ) ); 233 233 result->push_back( new ExprStmt( 234 new UntypedExpr( new NameExpr( "__cfa abi_ehm__rethrow_terminate" ) )234 new UntypedExpr( new NameExpr( "__cfaehm__rethrow_terminate" ) ) 235 235 ) ); 236 236 delete throwStmt; … … 241 241 ThrowStmt *throwStmt ) { 242 242 // __throw_resume( `throwStmt->get_name` ); 243 return create_given_throw( "__cfa abi_ehm__throw_resume", throwStmt );243 return create_given_throw( "__cfaehm__throw_resume", throwStmt ); 244 244 } 245 245 … … 309 309 local_except->get_attributes().push_back( new Attribute( 310 310 "cleanup", 311 { new NameExpr( "__cfa abi_ehm__cleanup_terminate" ) }311 { new NameExpr( "__cfaehm__cleanup_terminate" ) } 312 312 ) ); 313 313 … … 316 316 VarExprReplacer::DeclMap mapping; 317 317 mapping[ handler_decl ] = local_except; 318 VarExprReplacer::replace( handler->body, mapping ); 318 VarExprReplacer mapper( mapping ); 319 handler->get_body()->accept( mapper ); 319 320 } 320 321 … … 429 430 FunctionDecl * terminate_catch, 430 431 FunctionDecl * terminate_match ) { 431 // { __cfa abi_ehm__try_terminate(`try`, `catch`, `match`); }432 // { __cfaehm__try_terminate(`try`, `catch`, `match`); } 432 433 433 434 UntypedExpr * caller = new UntypedExpr( new NameExpr( 434 "__cfa abi_ehm__try_terminate" ) );435 "__cfaehm__try_terminate" ) ); 435 436 std::list<Expression *>& args = caller->get_args(); 436 437 args.push_back( nameOf( try_wrapper ) ); … … 486 487 487 488 // struct __try_resume_node __resume_node 488 // __attribute__((cleanup( __cfa abi_ehm__try_resume_cleanup )));489 // __attribute__((cleanup( __cfaehm__try_resume_cleanup ))); 489 490 // ** unwinding of the stack here could cause problems ** 490 491 // ** however I don't think that can happen currently ** 491 // __cfa abi_ehm__try_resume_setup( &__resume_node, resume_handler );492 // __cfaehm__try_resume_setup( &__resume_node, resume_handler ); 492 493 493 494 std::list< Attribute * > attributes; … … 495 496 std::list< Expression * > attr_params; 496 497 attr_params.push_back( new NameExpr( 497 "__cfa abi_ehm__try_resume_cleanup" ) );498 "__cfaehm__try_resume_cleanup" ) ); 498 499 attributes.push_back( new Attribute( "cleanup", attr_params ) ); 499 500 } … … 514 515 515 516 UntypedExpr *setup = new UntypedExpr( new NameExpr( 516 "__cfa abi_ehm__try_resume_setup" ) );517 "__cfaehm__try_resume_setup" ) ); 517 518 setup->get_args().push_back( new AddressExpr( nameOf( obj ) ) ); 518 519 setup->get_args().push_back( nameOf( resume_handler ) ); … … 539 540 ObjectDecl * ExceptionMutatorCore::create_finally_hook( 540 541 FunctionDecl * finally_wrapper ) { 541 // struct __cfa abi_ehm__cleanup_hook __finally_hook542 // struct __cfaehm__cleanup_hook __finally_hook 542 543 // __attribute__((cleanup( finally_wrapper ))); 543 544 … … 593 594 // Skip children? 594 595 return; 595 } else if ( structDecl->get_name() == "__cfa abi_ehm__base_exception_t" ) {596 } else if ( structDecl->get_name() == "__cfaehm__base_exception_t" ) { 596 597 assert( nullptr == except_decl ); 597 598 except_decl = structDecl; 598 599 init_func_types(); 599 } else if ( structDecl->get_name() == "__cfa abi_ehm__try_resume_node" ) {600 } else if ( structDecl->get_name() == "__cfaehm__try_resume_node" ) { 600 601 assert( nullptr == node_decl ); 601 602 node_decl = structDecl; 602 } else if ( structDecl->get_name() == "__cfa abi_ehm__cleanup_hook" ) {603 } else if ( structDecl->get_name() == "__cfaehm__cleanup_hook" ) { 603 604 assert( nullptr == hook_decl ); 604 605 hook_decl = structDecl;
Note:
See TracChangeset
for help on using the changeset viewer.