Changeset dcbb03b for src/Concurrency
- Timestamp:
- Mar 1, 2018, 9:29:03 AM (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:
- 1f37ed02
- Parents:
- b002261 (diff), 446ffa3 (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/Concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
rb002261 rdcbb03b 25 25 #include "InitTweak/InitTweak.h" // for getPointerBase 26 26 #include "Parser/LinkageSpec.h" // for Cforall 27 #include "SymTab/AddVisit.h" // for acceptAndAdd28 27 #include "SynTree/Constant.h" // for Constant 29 28 #include "SynTree/Declaration.h" // for StructDecl, FunctionDecl, ObjectDecl … … 281 280 if( ! decl->body ) return; 282 281 283 if( !type_decl ) throwSemanticError( decl, context_error );282 if( !type_decl ) SemanticError( decl, context_error ); 284 283 285 284 FunctionDecl * func = forwardDeclare( decl ); … … 418 417 if( mutexArgs.empty() ) return; 419 418 420 if( CodeGen::isConstructor(decl->name) ) throwSemanticError( decl, "constructors cannot have mutex parameters" );419 if( CodeGen::isConstructor(decl->name) ) SemanticError( decl, "constructors cannot have mutex parameters" ); 421 420 422 421 bool isDtor = CodeGen::isDestructor( decl->name ); 423 422 424 if( isDtor && mutexArgs.size() != 1 ) throwSemanticError( decl, "destructors can only have 1 mutex argument" );423 if( isDtor && mutexArgs.size() != 1 ) SemanticError( decl, "destructors can only have 1 mutex argument" ); 425 424 426 425 for(auto arg : mutexArgs) { … … 431 430 if( ! body ) return; 432 431 433 if( !monitor_decl ) throw SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor>" ); 434 if( !guard_decl ) throw SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor>" ); 435 if( !dtor_guard_decl ) throw SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor>" ); 432 if( !monitor_decl || !guard_decl || !dtor_guard_decl ) 433 SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor>" ); 436 434 437 435 if( isDtor ) { … … 479 477 //Makes sure it's not a copy 480 478 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 481 if( ! rty ) throwSemanticError( arg, "Mutex argument must be of reference type " );479 if( ! rty ) SemanticError( arg, "Mutex argument must be of reference type " ); 482 480 483 481 //Make sure the we are pointing directly to a type 484 482 Type* base = rty->get_base(); 485 if( dynamic_cast< ReferenceType * >( base ) ) throwSemanticError( arg, "Mutex argument have exactly one level of indirection " );486 if( dynamic_cast< PointerType * >( base ) ) throwSemanticError( arg, "Mutex argument have exactly one level of indirection " );483 if( dynamic_cast< ReferenceType * >( base ) ) SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 484 if( dynamic_cast< PointerType * >( base ) ) SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 487 485 488 486 //Make sure that typed isn't mutex 489 if( base->get_mutex() ) throwSemanticError( arg, "mutex keyword may only appear once per argument " );487 if( base->get_mutex() ) SemanticError( arg, "mutex keyword may only appear once per argument " ); 490 488 } 491 489 … … 625 623 if( type && type->get_baseStruct()->is_thread() ) { 626 624 if( !thread_decl || !thread_ctor_seen ) { 627 throwSemanticError( type->get_baseStruct()->location, "thread keyword requires threads to be in scope, add #include <thread>");625 SemanticError( type->get_baseStruct()->location, "thread keyword requires threads to be in scope, add #include <thread>"); 628 626 } 629 627 -
src/Concurrency/Waitfor.cc
rb002261 rdcbb03b 250 250 Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) { 251 251 if( !decl_monitor || !decl_acceptable || !decl_mask ) 252 throwSemanticError( waitfor, "waitfor keyword requires monitors to be in scope, add #include <monitor>" );252 SemanticError( waitfor, "waitfor keyword requires monitors to be in scope, add #include <monitor>" ); 253 253 254 254 CompoundStmt * stmt = new CompoundStmt();
Note:
See TracChangeset
for help on using the changeset viewer.