Changes in src/Concurrency/Keywords.cc [69c5c00:77a2994]
- File:
-
- 1 edited
-
src/Concurrency/Keywords.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
r69c5c00 r77a2994 66 66 bool needs_main, AggregateDecl::Aggregate cast_target ) : 67 67 type_name( type_name ), field_name( field_name ), getter_name( getter_name ), 68 context_error( context_error ), exception_name( exception_name ), 69 vtable_name( getVTableName( exception_name ) ), 68 context_error( context_error ), vtable_name( getVTableName( exception_name ) ), 70 69 needs_main( needs_main ), cast_target( cast_target ) {} 71 70 … … 90 89 const std::string getter_name; 91 90 const std::string context_error; 92 const std::string exception_name;93 91 const std::string vtable_name; 94 92 bool needs_main; … … 97 95 StructDecl * type_decl = nullptr; 98 96 FunctionDecl * dtor_decl = nullptr; 99 StructDecl * except_decl = nullptr;100 97 StructDecl * vtable_decl = nullptr; 101 98 }; … … 379 376 else if ( is_target(decl) ) { 380 377 handle( decl ); 381 }382 else if ( !except_decl && exception_name == decl->name && decl->body ) {383 except_decl = decl;384 378 } 385 379 else if ( !vtable_decl && vtable_name == decl->name && decl->body ) { … … 404 398 assert( struct_type ); 405 399 406 std::list< Expression * > poly_args = { new TypeExpr( struct_type->clone() ) }; 407 ObjectDecl * vtable_object = Virtual::makeVtableInstance( 408 vtable_decl->makeInst( poly_args ), struct_type, nullptr ); 409 declsToAddAfter.push_back( vtable_object ); 410 declsToAddAfter.push_back( Virtual::makeGetExceptionFunction( 411 vtable_object, except_decl->makeInst( std::move( poly_args ) ) 412 ) ); 400 declsToAddAfter.push_back( Virtual::makeVtableInstance( vtable_decl, { 401 new TypeExpr( struct_type->clone() ), 402 }, struct_type, nullptr ) ); 413 403 } 414 404 … … 444 434 void ConcurrentSueKeyword::addVtableForward( StructDecl * decl ) { 445 435 if ( vtable_decl ) { 446 std::list< Expression * > poly_args ={436 declsToAddBefore.push_back( Virtual::makeVtableForward( vtable_decl, { 447 437 new TypeExpr( new StructInstType( noQualifiers, decl ) ), 448 }; 449 declsToAddBefore.push_back( Virtual::makeGetExceptionForward( 450 vtable_decl->makeInst( poly_args ), 451 except_decl->makeInst( poly_args ) 452 ) ); 453 declsToAddBefore.push_back( Virtual::makeVtableForward( 454 vtable_decl->makeInst( move( poly_args ) ) ) ); 438 } ) ); 455 439 // Its only an error if we want a vtable and don't have one. 456 440 } else if ( ! vtable_name.empty() ) {
Note:
See TracChangeset
for help on using the changeset viewer.