Changes in / [71e555c:4ee3b0c1]
- File:
-
- 1 edited
-
src/Concurrency/Keywords.cc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
r71e555c r4ee3b0c1 191 191 void postvisit( StructDecl * decl ); 192 192 193 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* , bool & first);193 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* ); 194 194 void validate( DeclarationWithType * ); 195 195 void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &); … … 441 441 void MutexKeyword::postvisit(FunctionDecl* decl) { 442 442 443 bool first = false; 444 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl, first ); 443 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl ); 445 444 if( mutexArgs.empty() ) return; 446 445 447 if( CodeGen::isConstructor(decl->name) && first) SemanticError( decl, "constructors cannot have mutex parameters" );446 if( CodeGen::isConstructor(decl->name) ) SemanticError( decl, "constructors cannot have mutex parameters" ); 448 447 449 448 bool isDtor = CodeGen::isDestructor( decl->name ); … … 485 484 } 486 485 487 std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl , bool & first) {486 std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl ) { 488 487 std::list<DeclarationWithType*> mutexArgs; 489 488 490 bool once = true;491 489 for( auto arg : decl->get_functionType()->get_parameters()) { 492 490 //Find mutex arguments 493 491 Type* ty = arg->get_type(); 494 492 if( ! ty->get_mutex() ) continue; 495 496 if(once) {first = true;}497 once = false;498 493 499 494 //Append it to the list
Note:
See TracChangeset
for help on using the changeset viewer.