Changeset 0794365 for src/Concurrency


Ignore:
Timestamp:
Jun 4, 2023, 8:38:45 AM (13 months ago)
Author:
caparsons <caparson@…>
Branches:
ast-experimental, master
Children:
c880a7b
Parents:
46e6e47
Message:

refactored allocation enum to match naming style and refactored some verifyf's to be aborts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Actors.cpp

    r46e6e47 r0794365  
    3838    bool namedDecl = false;
    3939
    40     // finds and sets a ptr to the Allocation enum, which is needed in the next pass
     40    // finds and sets a ptr to the allocation enum, which is needed in the next pass
    4141    void previsit( const EnumDecl * decl ) {
    42         if( decl->name == "Allocation" ) *allocationDecl = decl;
     42        if( decl->name == "allocation" ) *allocationDecl = decl;
    4343    }
    4444
     
    227227                static inline derived_actor & ?|?( derived_actor & receiver, derived_msg & msg ) {
    228228                    request new_req;
    229                     Allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;
     229                    allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;
    230230                    __receive_fn fn = (__receive_fn)my_work_fn;
    231231                    new_req{ &receiver, &msg, fn };
     
    246246            ));
    247247           
    248             // Function type is: Allocation (*)( derived_actor &, derived_msg & )
     248            // Function type is: allocation (*)( derived_actor &, derived_msg & )
    249249            FunctionType * derivedReceive = new FunctionType();
    250250            derivedReceive->params.push_back( ast::deepCopy( derivedActorRef ) );
     
    252252            derivedReceive->returns.push_back( new EnumInstType( *allocationDecl ) );
    253253
    254             // Generates: Allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;
     254            // Generates: allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;
    255255            sendBody->push_back( new DeclStmt(
    256256                decl->location,
     
    263263            ));
    264264
    265             // Function type is: Allocation (*)( actor &, message & )
     265            // Function type is: allocation (*)( actor &, message & )
    266266            FunctionType * genericReceive = new FunctionType();
    267267            genericReceive->params.push_back( new ReferenceType( new StructInstType( *actorDecl ) ) );
     
    269269            genericReceive->returns.push_back( new EnumInstType( *allocationDecl ) );
    270270
    271             // Generates: Allocation (*fn)( actor &, message & ) = (Allocation (*)( actor &, message & ))my_work_fn;
     271            // Generates: allocation (*fn)( actor &, message & ) = (allocation (*)( actor &, message & ))my_work_fn;
    272272            // More readable synonymous code:
    273             //     typedef Allocation (*__receive_fn)(actor &, message &);
     273            //     typedef allocation (*__receive_fn)(actor &, message &);
    274274            //     __receive_fn fn = (__receive_fn)my_work_fn;
    275275            sendBody->push_back( new DeclStmt(
     
    422422    const StructDecl ** msgDecl = &msgDeclPtr;
    423423
    424     // first pass collects ptrs to Allocation enum, request type, and generic receive fn typedef
     424    // first pass collects ptrs to allocation enum, request type, and generic receive fn typedef
    425425    // also populates maps of all derived actors and messages
    426426    Pass<CollectactorStructDecls>::run( translationUnit, actorStructDecls, messageStructDecls, requestDecl,
Note: See TracChangeset for help on using the changeset viewer.