Changeset d55d7a6 for src/Concurrency


Ignore:
Timestamp:
Feb 15, 2018, 3:58:56 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
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
Message:

Massive change to errors to enable warnings

Location:
src/Concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    rd27e340 rd55d7a6  
    276276                        handle( decl );
    277277                }
    278 
    279278        }
    280279
     
    282281                if( ! decl->body ) return;
    283282
    284                 if( !type_decl ) throw SemanticError( context_error, decl );
     283                if( !type_decl ) throw SemanticError( decl, context_error );
    285284
    286285                FunctionDecl * func = forwardDeclare( decl );
     
    419418                if( mutexArgs.empty() ) return;
    420419
    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" );
    422421
    423422                bool isDtor = CodeGen::isDestructor( decl->name );
    424423
    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" );
    426425
    427426                for(auto arg : mutexArgs) {
     
    432431                if( ! body ) return;
    433432
    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>" );
    437436
    438437                if( isDtor ) {
     
    480479                //Makes sure it's not a copy
    481480                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 " );
    483482
    484483                //Make sure the we are pointing directly to a type
    485484                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 " );
    488487
    489488                //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 " );
    491490        }
    492491
     
    626625                if( type && type->get_baseStruct()->is_thread() ) {
    627626                        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>");
    629628                        }
    630629
  • src/Concurrency/Waitfor.cc

    rd27e340 rd55d7a6  
    249249
    250250        Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) {
    251                 if( !decl_monitor || !decl_acceptable || !decl_mask ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor );
     251                if( !decl_monitor || !decl_acceptable || !decl_mask )
     252                        throw SemanticError( waitfor, "waitfor keyword requires monitors to be in scope, add #include <monitor>" );
    252253
    253254                CompoundStmt * stmt = new CompoundStmt();
Note: See TracChangeset for help on using the changeset viewer.