Changeset a16764a6 for src/Concurrency/Keywords.cc
- Timestamp:
- Feb 28, 2018, 4:48:22 PM (6 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:
- 446ffa3
- Parents:
- 6a8df56
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
r6a8df56 ra16764a6 280 280 if( ! decl->body ) return; 281 281 282 if( !type_decl ) throwSemanticError( decl, context_error );282 if( !type_decl ) SemanticError( decl, context_error ); 283 283 284 284 FunctionDecl * func = forwardDeclare( decl ); … … 417 417 if( mutexArgs.empty() ) return; 418 418 419 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" ); 420 420 421 421 bool isDtor = CodeGen::isDestructor( decl->name ); 422 422 423 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" ); 424 424 425 425 for(auto arg : mutexArgs) { … … 430 430 if( ! body ) return; 431 431 432 if( !monitor_decl ) throw SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor>" ); 433 if( !guard_decl ) throw SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor>" ); 434 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>" ); 435 434 436 435 if( isDtor ) { … … 478 477 //Makes sure it's not a copy 479 478 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 480 if( ! rty ) throwSemanticError( arg, "Mutex argument must be of reference type " );479 if( ! rty ) SemanticError( arg, "Mutex argument must be of reference type " ); 481 480 482 481 //Make sure the we are pointing directly to a type 483 482 Type* base = rty->get_base(); 484 if( dynamic_cast< ReferenceType * >( base ) ) throwSemanticError( arg, "Mutex argument have exactly one level of indirection " );485 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 " ); 486 485 487 486 //Make sure that typed isn't mutex 488 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 " ); 489 488 } 490 489 … … 624 623 if( type && type->get_baseStruct()->is_thread() ) { 625 624 if( !thread_decl || !thread_ctor_seen ) { 626 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>"); 627 626 } 628 627
Note: See TracChangeset
for help on using the changeset viewer.