Changeset a64137f
- Timestamp:
- Feb 1, 2023, 4:32:29 PM (22 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- ccf1d99
- Parents:
- 1f35220
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Actors.cpp
r1f35220 ra64137f 180 180 }; 181 181 182 #define __ALLOC 0 183 182 184 struct GenReceiveDecls : public ast::WithDeclsToAdd<> { 183 185 unordered_set<const StructDecl *> & actorStructDecls; … … 226 228 CompoundStmt * sendBody = new CompoundStmt( decl->location ); 227 229 230 #if __ALLOC 228 231 // Generates: request * new_req = alloc(); 229 232 sendBody->push_back( new DeclStmt( … … 236 239 ) 237 240 )); 241 #else 242 // Generates: request new_req; 243 sendBody->push_back( new DeclStmt( 244 decl->location, 245 new ObjectDecl( 246 decl->location, 247 "new_req", 248 new StructInstType( *requestDecl ) 249 ) 250 )); 251 #endif 238 252 239 253 // Function type is: Allocation (*)( derived_actor &, derived_msg & ) … … 276 290 )); 277 291 292 #if __ALLOC 278 293 // Generates: (*new_req){ &receiver, &msg, fn }; 279 294 sendBody->push_back( new ExprStmt( … … 305 320 ) 306 321 )); 322 #else 323 // Generates: new_req{ &receiver, &msg, fn }; 324 sendBody->push_back( new ExprStmt( 325 decl->location, 326 new UntypedExpr ( 327 decl->location, 328 new NameExpr( decl->location, "?{}" ), 329 { 330 new NameExpr( decl->location, "new_req" ), 331 new AddressExpr( new NameExpr( decl->location, "receiver" ) ), 332 new AddressExpr( new NameExpr( decl->location, "msg" ) ), 333 new NameExpr( decl->location, "fn" ) 334 } 335 ) 336 )); 337 338 // Generates: send( receiver, new_req ); 339 sendBody->push_back( new ExprStmt( 340 decl->location, 341 new UntypedExpr ( 342 decl->location, 343 new NameExpr( decl->location, "send" ), 344 { 345 { 346 new NameExpr( decl->location, "receiver" ), 347 new NameExpr( decl->location, "new_req" ) 348 } 349 } 350 ) 351 )); 352 #endif 307 353 308 354 // Generates: return receiver;
Note: See TracChangeset
for help on using the changeset viewer.