Changeset 747a7c1 for src


Ignore:
Timestamp:
Feb 10, 2023, 12:15:06 PM (15 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
966b4c6
Parents:
8fa77eb (diff), 5e3f1e1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/ScopedMap.h

    r8fa77eb r747a7c1  
    170170        size_type erase( const Key & key ) {
    171171                for ( auto it = scopes.rbegin() ; it != scopes.rend() ; ++it ) {
    172                         if ( size_type i = it->map.erase( key ) ; 0 != i ) return i;
     172                        size_type i = it->map.erase( key );
     173                        if ( 0 != i ) return i;
    173174                }
    174175                return 0;
  • src/Concurrency/Actors.cpp

    r8fa77eb r747a7c1  
    180180};
    181181
    182 #define __ALLOC 0 // C_TODO: complete swap to no-alloc version
    183 
    184182struct GenReceiveDecls : public ast::WithDeclsToAdd<> {
    185183    unordered_set<const StructDecl *> & actorStructDecls;
     
    218216            /*
    219217                static inline derived_actor & ?|?( derived_actor & receiver, derived_msg & msg ) {
    220                     request * new_req = alloc();
     218                    request new_req;
    221219                    Allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;
    222220                    __receive_fn fn = (__receive_fn)my_work_fn;
    223                     (*new_req){ &receiver, &msg, fn };
    224                     send( receiver, *new_req );
     221                    new_req{ &receiver, &msg, fn };
     222                    send( receiver, new_req );
    225223                    return receiver;
    226224                }
     
    228226            CompoundStmt * sendBody = new CompoundStmt( decl->location );
    229227
    230             #if __ALLOC
    231             // Generates: request * new_req = alloc();
    232             sendBody->push_back( new DeclStmt(
    233                 decl->location,
    234                 new ObjectDecl(
    235                     decl->location,
    236                     "new_req",
    237                     new PointerType( new StructInstType( *requestDecl ) ),
    238                     new SingleInit( decl->location, new UntypedExpr( decl->location, new NameExpr( decl->location, "alloc" ), {} ) )
    239                 )
    240             ));
    241             #else
    242228            // Generates: request new_req;
    243229            sendBody->push_back( new DeclStmt(
     
    249235                )
    250236            ));
    251             #endif
    252237           
    253238            // Function type is: Allocation (*)( derived_actor &, derived_msg & )
     
    290275            ));
    291276
    292             #if __ALLOC
    293             // Generates: (*new_req){ &receiver, &msg, fn };
    294             sendBody->push_back( new ExprStmt(
    295                 decl->location,
    296                                 new UntypedExpr (
    297                     decl->location,
    298                                         new NameExpr( decl->location, "?{}" ),
    299                                         {
    300                                                 new UntypedExpr( decl->location, new NameExpr( decl->location, "*?" ), {  new NameExpr( decl->location, "new_req" ) } ),
    301                         new AddressExpr( new NameExpr( decl->location, "receiver" ) ),
    302                         new AddressExpr( new NameExpr( decl->location, "msg" ) ),
    303                         new NameExpr( decl->location, "fn" )
    304                                         }
    305                                 )
    306                         ));
    307 
    308             // Generates: send( receiver, *new_req );
    309             sendBody->push_back( new ExprStmt(
    310                 decl->location,
    311                                 new UntypedExpr (
    312                     decl->location,
    313                                         new NameExpr( decl->location, "send" ),
    314                                         {
    315                                                 {
    316                             new NameExpr( decl->location, "receiver" ),
    317                             new UntypedExpr( decl->location, new NameExpr( decl->location, "*?" ), {  new NameExpr( decl->location, "new_req" ) } )
    318                         }
    319                                         }
    320                                 )
    321                         ));
    322             #else
    323277            // Generates: new_req{ &receiver, &msg, fn };
    324278            sendBody->push_back( new ExprStmt(
     
    350304                                )
    351305                        ));
    352             #endif
    353306           
    354307            // Generates: return receiver;
  • src/GenPoly/Box.cc

    r8fa77eb r747a7c1  
    8080                        CallAdapter();
    8181
     82                        void premutate( Declaration * declaration );
    8283                        void premutate( FunctionDecl * functionDecl );
    8384                        void premutate( TypeDecl * typeDecl );
     
    454455
    455456                CallAdapter::CallAdapter() : tempNamer( "_temp" ) {}
     457
     458                void CallAdapter::premutate( Declaration * ) {
     459                        // Prevent type declaration information from leaking out.
     460                        GuardScope( scopeTyVars );
     461                }
    456462
    457463                void CallAdapter::premutate( FunctionDecl *functionDecl ) {
Note: See TracChangeset for help on using the changeset viewer.