Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r69c5c00 r77a2994  
    6666                        bool needs_main, AggregateDecl::Aggregate cast_target ) :
    6767                  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 ) ),
    7069                  needs_main( needs_main ), cast_target( cast_target ) {}
    7170
     
    9089                const std::string getter_name;
    9190                const std::string context_error;
    92                 const std::string exception_name;
    9391                const std::string vtable_name;
    9492                bool needs_main;
     
    9795                StructDecl   * type_decl = nullptr;
    9896                FunctionDecl * dtor_decl = nullptr;
    99                 StructDecl * except_decl = nullptr;
    10097                StructDecl * vtable_decl = nullptr;
    10198        };
     
    379376                else if ( is_target(decl) ) {
    380377                        handle( decl );
    381                 }
    382                 else if ( !except_decl && exception_name == decl->name && decl->body ) {
    383                         except_decl = decl;
    384378                }
    385379                else if ( !vtable_decl && vtable_name == decl->name && decl->body ) {
     
    404398                        assert( struct_type );
    405399
    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 ) );
    413403                }
    414404
     
    444434        void ConcurrentSueKeyword::addVtableForward( StructDecl * decl ) {
    445435                if ( vtable_decl ) {
    446                         std::list< Expression * > poly_args = {
     436                        declsToAddBefore.push_back( Virtual::makeVtableForward( vtable_decl, {
    447437                                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                        } ) );
    455439                // Its only an error if we want a vtable and don't have one.
    456440                } else if ( ! vtable_name.empty() ) {
Note: See TracChangeset for help on using the changeset viewer.