Changes in / [71e555c:4ee3b0c1]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r71e555c r4ee3b0c1  
    191191                void postvisit(   StructDecl * decl );
    192192
    193                 std::list<DeclarationWithType*> findMutexArgs( FunctionDecl*, bool & first );
     193                std::list<DeclarationWithType*> findMutexArgs( FunctionDecl* );
    194194                void validate( DeclarationWithType * );
    195195                void addDtorStatments( FunctionDecl* func, CompoundStmt *, const std::list<DeclarationWithType * > &);
     
    441441        void MutexKeyword::postvisit(FunctionDecl* decl) {
    442442
    443                 bool first = false;
    444                 std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl, first );
     443                std::list<DeclarationWithType*> mutexArgs = findMutexArgs( decl );
    445444                if( mutexArgs.empty() ) return;
    446445
    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" );
    448447
    449448                bool isDtor = CodeGen::isDestructor( decl->name );
     
    485484        }
    486485
    487         std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl, bool & first ) {
     486        std::list<DeclarationWithType*> MutexKeyword::findMutexArgs( FunctionDecl* decl ) {
    488487                std::list<DeclarationWithType*> mutexArgs;
    489488
    490                 bool once = true;
    491489                for( auto arg : decl->get_functionType()->get_parameters()) {
    492490                        //Find mutex arguments
    493491                        Type* ty = arg->get_type();
    494492                        if( ! ty->get_mutex() ) continue;
    495 
    496                         if(once) {first = true;}
    497                         once = false;
    498493
    499494                        //Append it to the list
Note: See TracChangeset for help on using the changeset viewer.