- Timestamp:
- Feb 10, 2023, 12:15:06 PM (15 months ago)
- 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. - Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/ScopedMap.h
r8fa77eb r747a7c1 170 170 size_type erase( const Key & key ) { 171 171 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; 173 174 } 174 175 return 0; -
src/Concurrency/Actors.cpp
r8fa77eb r747a7c1 180 180 }; 181 181 182 #define __ALLOC 0 // C_TODO: complete swap to no-alloc version183 184 182 struct GenReceiveDecls : public ast::WithDeclsToAdd<> { 185 183 unordered_set<const StructDecl *> & actorStructDecls; … … 218 216 /* 219 217 static inline derived_actor & ?|?( derived_actor & receiver, derived_msg & msg ) { 220 request * new_req = alloc();218 request new_req; 221 219 Allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive; 222 220 __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 ); 225 223 return receiver; 226 224 } … … 228 226 CompoundStmt * sendBody = new CompoundStmt( decl->location ); 229 227 230 #if __ALLOC231 // 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 #else242 228 // Generates: request new_req; 243 229 sendBody->push_back( new DeclStmt( … … 249 235 ) 250 236 )); 251 #endif252 237 253 238 // Function type is: Allocation (*)( derived_actor &, derived_msg & ) … … 290 275 )); 291 276 292 #if __ALLOC293 // 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 #else323 277 // Generates: new_req{ &receiver, &msg, fn }; 324 278 sendBody->push_back( new ExprStmt( … … 350 304 ) 351 305 )); 352 #endif353 306 354 307 // Generates: return receiver; -
src/GenPoly/Box.cc
r8fa77eb r747a7c1 80 80 CallAdapter(); 81 81 82 void premutate( Declaration * declaration ); 82 83 void premutate( FunctionDecl * functionDecl ); 83 84 void premutate( TypeDecl * typeDecl ); … … 454 455 455 456 CallAdapter::CallAdapter() : tempNamer( "_temp" ) {} 457 458 void CallAdapter::premutate( Declaration * ) { 459 // Prevent type declaration information from leaking out. 460 GuardScope( scopeTyVars ); 461 } 456 462 457 463 void CallAdapter::premutate( FunctionDecl *functionDecl ) {
Note: See TracChangeset
for help on using the changeset viewer.