Changes in src/Concurrency/Actors.cpp [086d6b8:3830c84]
- File:
-
- 1 edited
-
src/Concurrency/Actors.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Actors.cpp
r086d6b8 r3830c84 38 38 bool namedDecl = false; 39 39 40 // finds and sets a ptr to the allocation enum, which is needed in the next pass40 // finds and sets a ptr to the Allocation enum, which is needed in the next pass 41 41 void previsit( const EnumDecl * decl ) { 42 if( decl->name == " allocation" ) *allocationDecl = decl;42 if( decl->name == "Allocation" ) *allocationDecl = decl; 43 43 } 44 44 … … 227 227 static inline derived_actor & ?|?( derived_actor & receiver, derived_msg & msg ) { 228 228 request new_req; 229 allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;229 Allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive; 230 230 __receive_fn fn = (__receive_fn)my_work_fn; 231 231 new_req{ &receiver, &msg, fn }; … … 246 246 )); 247 247 248 // Function type is: allocation (*)( derived_actor &, derived_msg & )248 // Function type is: Allocation (*)( derived_actor &, derived_msg & ) 249 249 FunctionType * derivedReceive = new FunctionType(); 250 250 derivedReceive->params.push_back( ast::deepCopy( derivedActorRef ) ); … … 252 252 derivedReceive->returns.push_back( new EnumInstType( *allocationDecl ) ); 253 253 254 // Generates: allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive;254 // Generates: Allocation (*my_work_fn)( derived_actor &, derived_msg & ) = receive; 255 255 sendBody->push_back( new DeclStmt( 256 256 decl->location, … … 263 263 )); 264 264 265 // Function type is: allocation (*)( actor &, message & )265 // Function type is: Allocation (*)( actor &, message & ) 266 266 FunctionType * genericReceive = new FunctionType(); 267 267 genericReceive->params.push_back( new ReferenceType( new StructInstType( *actorDecl ) ) ); … … 269 269 genericReceive->returns.push_back( new EnumInstType( *allocationDecl ) ); 270 270 271 // Generates: allocation (*fn)( actor &, message & ) = (allocation (*)( actor &, message & ))my_work_fn;271 // Generates: Allocation (*fn)( actor &, message & ) = (Allocation (*)( actor &, message & ))my_work_fn; 272 272 // More readable synonymous code: 273 // typedef allocation (*__receive_fn)(actor &, message &);273 // typedef Allocation (*__receive_fn)(actor &, message &); 274 274 // __receive_fn fn = (__receive_fn)my_work_fn; 275 275 sendBody->push_back( new DeclStmt( … … 285 285 )); 286 286 287 // Generates: new_req{ &receiver, (actor *)&receiver, &msg, (message *)&msg, fn };287 // Generates: new_req{ &receiver, &msg, fn }; 288 288 sendBody->push_back( new ExprStmt( 289 289 decl->location, … … 294 294 new NameExpr( decl->location, "new_req" ), 295 295 new AddressExpr( new NameExpr( decl->location, "receiver" ) ), 296 new CastExpr( decl->location, new AddressExpr( new NameExpr( decl->location, "receiver" ) ), new PointerType( new StructInstType( *actorDecl ) ), ExplicitCast ),297 296 new AddressExpr( new NameExpr( decl->location, "msg" ) ), 298 new CastExpr( decl->location, new AddressExpr( new NameExpr( decl->location, "msg" ) ), new PointerType( new StructInstType( *msgDecl ) ), ExplicitCast ),299 297 new NameExpr( decl->location, "fn" ) 300 298 } … … 323 321 FunctionDecl * sendOperatorFunction = new FunctionDecl( 324 322 decl->location, 325 "? |?",323 "?<<?", 326 324 {}, // forall 327 325 { … … 424 422 const StructDecl ** msgDecl = &msgDeclPtr; 425 423 426 // first pass collects ptrs to allocation enum, request type, and generic receive fn typedef424 // first pass collects ptrs to Allocation enum, request type, and generic receive fn typedef 427 425 // also populates maps of all derived actors and messages 428 426 Pass<CollectactorStructDecls>::run( translationUnit, actorStructDecls, messageStructDecls, requestDecl,
Note:
See TracChangeset
for help on using the changeset viewer.