Changeset d55d7a6 for src/Concurrency/Keywords.cc
- Timestamp:
- Feb 15, 2018, 3:58:56 PM (7 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:
- 75e3cb2
- Parents:
- d27e340
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
rd27e340 rd55d7a6 276 276 handle( decl ); 277 277 } 278 279 278 } 280 279 … … 282 281 if( ! decl->body ) return; 283 282 284 if( !type_decl ) throw SemanticError( context_error, decl);283 if( !type_decl ) throw SemanticError( decl, context_error ); 285 284 286 285 FunctionDecl * func = forwardDeclare( decl ); … … 419 418 if( mutexArgs.empty() ) return; 420 419 421 if( CodeGen::isConstructor(decl->name) ) throw SemanticError( "constructors cannot have mutex parameters", decl);420 if( CodeGen::isConstructor(decl->name) ) throw SemanticError( decl, "constructors cannot have mutex parameters" ); 422 421 423 422 bool isDtor = CodeGen::isDestructor( decl->name ); 424 423 425 if( isDtor && mutexArgs.size() != 1 ) throw SemanticError( "destructors can only have 1 mutex argument", decl);424 if( isDtor && mutexArgs.size() != 1 ) throw SemanticError( decl, "destructors can only have 1 mutex argument" ); 426 425 427 426 for(auto arg : mutexArgs) { … … 432 431 if( ! body ) return; 433 432 434 if( !monitor_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl);435 if( !guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl);436 if( !dtor_guard_decl ) throw SemanticError( "mutex keyword requires monitors to be in scope, add #include <monitor>", decl);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>" ); 437 436 438 437 if( isDtor ) { … … 480 479 //Makes sure it's not a copy 481 480 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 482 if( ! rty ) throw SemanticError( "Mutex argument must be of reference type ", arg);481 if( ! rty ) throw SemanticError( arg, "Mutex argument must be of reference type " ); 483 482 484 483 //Make sure the we are pointing directly to a type 485 484 Type* base = rty->get_base(); 486 if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg);487 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg);485 if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 486 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( arg, "Mutex argument have exactly one level of indirection " ); 488 487 489 488 //Make sure that typed isn't mutex 490 if( base->get_mutex() ) throw SemanticError( "mutex keyword may only appear once per argument ", arg);489 if( base->get_mutex() ) throw SemanticError( arg, "mutex keyword may only appear once per argument " ); 491 490 } 492 491 … … 626 625 if( type && type->get_baseStruct()->is_thread() ) { 627 626 if( !thread_decl || !thread_ctor_seen ) { 628 throw SemanticError( "thread keyword requires threads to be in scope, add #include <thread>");627 throw SemanticError( type->get_baseStruct()->location, "thread keyword requires threads to be in scope, add #include <thread>"); 629 628 } 630 629
Note: See TracChangeset
for help on using the changeset viewer.