Changeset ba3706f for src/Concurrency
- Timestamp:
- Nov 30, 2017, 4:43:59 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- c50d54d
- Parents:
- 4429b04
- Location:
- src/Concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
r4429b04 rba3706f 38 38 39 39 namespace Concurrency { 40 41 namespace {42 const std::list<Label> noLabels;43 const std::list< Attribute * > noAttributes;44 Type::StorageClasses noStorage;45 Type::Qualifiers noQualifiers;46 }47 48 40 //============================================================================================= 49 41 // Pass declarations … … 296 288 ObjectDecl * this_decl = new ObjectDecl( 297 289 "this", 298 noStorage ,290 noStorageClasses, 299 291 LinkageSpec::Cforall, 300 292 nullptr, … … 313 305 new ObjectDecl( 314 306 "ret", 315 noStorage ,307 noStorageClasses, 316 308 LinkageSpec::Cforall, 317 309 nullptr, … … 346 338 main_decl = new FunctionDecl( 347 339 "main", 348 noStorage ,340 noStorageClasses, 349 341 LinkageSpec::Cforall, 350 342 main_type, … … 363 355 ObjectDecl * field = new ObjectDecl( 364 356 field_name, 365 noStorage ,357 noStorageClasses, 366 358 LinkageSpec::Cforall, 367 359 nullptr, … … 379 371 380 372 void ConcurrentSueKeyword::addRoutines( ObjectDecl * field, FunctionDecl * func ) { 381 CompoundStmt * statement = new CompoundStmt( noLabels);373 CompoundStmt * statement = new CompoundStmt(); 382 374 statement->push_back( 383 375 new ReturnStmt( 384 noLabels,385 376 new AddressExpr( 386 377 new MemberExpr( … … 488 479 ObjectDecl * monitors = new ObjectDecl( 489 480 "__monitor", 490 noStorage ,481 noStorageClasses, 491 482 LinkageSpec::Cforall, 492 483 nullptr, … … 509 500 // monitor_guard_t __guard = { __monitors, #, func }; 510 501 body->push_front( 511 new DeclStmt( n oLabels, new ObjectDecl(502 new DeclStmt( new ObjectDecl( 512 503 "__guard", 513 noStorage ,504 noStorageClasses, 514 505 LinkageSpec::Cforall, 515 506 nullptr, … … 530 521 531 522 //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) }; 532 body->push_front( new DeclStmt( noLabels,monitors) );523 body->push_front( new DeclStmt( monitors) ); 533 524 } 534 525 … … 536 527 ObjectDecl * monitors = new ObjectDecl( 537 528 "__monitors", 538 noStorage ,529 noStorageClasses, 539 530 LinkageSpec::Cforall, 540 531 nullptr, … … 569 560 // monitor_guard_t __guard = { __monitors, #, func }; 570 561 body->push_front( 571 new DeclStmt( n oLabels, new ObjectDecl(562 new DeclStmt( new ObjectDecl( 572 563 "__guard", 573 noStorage ,564 noStorageClasses, 574 565 LinkageSpec::Cforall, 575 566 nullptr, … … 591 582 592 583 //monitor_desc * __monitors[] = { get_monitor(a), get_monitor(b) }; 593 body->push_front( new DeclStmt( noLabels,monitors) );584 body->push_front( new DeclStmt( monitors) ); 594 585 } 595 586 … … 631 622 stmt->push_back( 632 623 new ExprStmt( 633 noLabels,634 624 new UntypedExpr( 635 625 new NameExpr( "__thrd_start" ), -
src/Concurrency/Waitfor.cc
r4429b04 rba3706f 100 100 101 101 namespace Concurrency { 102 103 namespace {104 const std::list<Label> noLabels;105 const std::list< Attribute * > noAttributes;106 Type::StorageClasses noStorage;107 Type::Qualifiers noQualifiers;108 }109 110 102 //============================================================================================= 111 103 // Pass declarations … … 203 195 ResolvExpr::findVoidExpression( expr, indexer ); 204 196 205 return new ExprStmt( noLabels,expr );197 return new ExprStmt( expr ); 206 198 } 207 199 … … 259 251 if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor ); 260 252 261 CompoundStmt * stmt = new CompoundStmt( noLabels);253 CompoundStmt * stmt = new CompoundStmt(); 262 254 263 255 ObjectDecl * acceptables = declare( waitfor->clauses.size(), stmt ); … … 281 273 ); 282 274 283 CompoundStmt * compound = new CompoundStmt( noLabels);275 CompoundStmt * compound = new CompoundStmt(); 284 276 stmt->push_back( new IfStmt( 285 noLabels,286 277 safeCond( new VariableExpr( flag ) ), 287 278 compound, … … 313 304 ); 314 305 315 stmt->push_back( new DeclStmt( noLabels,acceptables) );306 stmt->push_back( new DeclStmt( acceptables) ); 316 307 317 308 Expression * set = new UntypedExpr( … … 326 317 ResolvExpr::findVoidExpression( set, indexer ); 327 318 328 stmt->push_back( new ExprStmt( noLabels,set ) );319 stmt->push_back( new ExprStmt( set ) ); 329 320 330 321 return acceptables; … … 341 332 ); 342 333 343 stmt->push_back( new DeclStmt( noLabels,flag) );334 stmt->push_back( new DeclStmt( flag) ); 344 335 345 336 return flag; … … 357 348 ResolvExpr::findVoidExpression( expr, indexer ); 358 349 359 return new ExprStmt( noLabels,expr );350 return new ExprStmt( expr ); 360 351 } 361 352 … … 399 390 ); 400 391 401 stmt->push_back( new DeclStmt( noLabels,mon) );392 stmt->push_back( new DeclStmt( mon) ); 402 393 403 394 return mon; … … 411 402 412 403 stmt->push_back( new IfStmt( 413 noLabels,414 404 safeCond( clause.condition ), 415 405 new CompoundStmt({ … … 447 437 ); 448 438 449 stmt->push_back( new DeclStmt( noLabels,timeout ) );439 stmt->push_back( new DeclStmt( timeout ) ); 450 440 451 441 if( time ) { 452 442 stmt->push_back( new IfStmt( 453 noLabels,454 443 safeCond( time_cond ), 455 444 new CompoundStmt({ 456 445 new ExprStmt( 457 noLabels,458 446 makeOpAssign( 459 447 new VariableExpr( timeout ), … … 471 459 if( has_else ) { 472 460 stmt->push_back( new IfStmt( 473 noLabels,474 461 safeCond( else_cond ), 475 462 new CompoundStmt({ 476 463 new ExprStmt( 477 noLabels,478 464 makeOpAssign( 479 465 new VariableExpr( timeout ), … … 511 497 ); 512 498 513 stmt->push_back( new DeclStmt( noLabels,index ) );499 stmt->push_back( new DeclStmt( index ) ); 514 500 515 501 ObjectDecl * mask = ObjectDecl::newObject( … … 526 512 ); 527 513 528 stmt->push_back( new DeclStmt( noLabels,mask ) );514 stmt->push_back( new DeclStmt( mask ) ); 529 515 530 516 stmt->push_back( new ExprStmt( 531 noLabels,532 517 new ApplicationExpr( 533 518 VariableExpr::functionPointer( decl_waitfor ), … … 557 542 ) { 558 543 SwitchStmt * swtch = new SwitchStmt( 559 noLabels,560 544 result, 561 545 std::list<Statement *>() … … 566 550 swtch->statements.push_back( 567 551 new CaseStmt( 568 noLabels,569 552 new ConstantExpr( Constant::from_ulong( i++ ) ), 570 553 { 571 554 clause.statement, 572 555 new BranchStmt( 573 noLabels,574 556 "", 575 557 BranchStmt::Break … … 583 565 swtch->statements.push_back( 584 566 new CaseStmt( 585 noLabels,586 567 new ConstantExpr( Constant::from_int( -2 ) ), 587 568 { 588 569 waitfor->timeout.statement, 589 570 new BranchStmt( 590 noLabels,591 571 "", 592 572 BranchStmt::Break … … 600 580 swtch->statements.push_back( 601 581 new CaseStmt( 602 noLabels,603 582 new ConstantExpr( Constant::from_int( -1 ) ), 604 583 { 605 584 waitfor->orelse.statement, 606 585 new BranchStmt( 607 noLabels,608 586 "", 609 587 BranchStmt::Break
Note:
See TracChangeset
for help on using the changeset viewer.