Ignore:
Timestamp:
Feb 28, 2018, 4:48:22 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:
446ffa3
Parents:
6a8df56
Message:

Changed warning system to prepare for toggling warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r6a8df56 ra16764a6  
    280280                if( ! decl->body ) return;
    281281
    282                 if( !type_decl ) throw SemanticError( decl, context_error );
     282                if( !type_decl ) SemanticError( decl, context_error );
    283283
    284284                FunctionDecl * func = forwardDeclare( decl );
     
    417417                if( mutexArgs.empty() ) return;
    418418
    419                 if( CodeGen::isConstructor(decl->name) ) throw SemanticError( decl, "constructors cannot have mutex parameters" );
     419                if( CodeGen::isConstructor(decl->name) ) SemanticError( decl, "constructors cannot have mutex parameters" );
    420420
    421421                bool isDtor = CodeGen::isDestructor( decl->name );
    422422
    423                 if( isDtor && mutexArgs.size() != 1 ) throw SemanticError( decl, "destructors can only have 1 mutex argument" );
     423                if( isDtor && mutexArgs.size() != 1 ) SemanticError( decl, "destructors can only have 1 mutex argument" );
    424424
    425425                for(auto arg : mutexArgs) {
     
    430430                if( ! body ) return;
    431431
    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>" );
    435434
    436435                if( isDtor ) {
     
    478477                //Makes sure it's not a copy
    479478                ReferenceType* rty = dynamic_cast< ReferenceType * >( ty );
    480                 if( ! rty ) throw SemanticError( arg, "Mutex argument must be of reference type " );
     479                if( ! rty ) SemanticError( arg, "Mutex argument must be of reference type " );
    481480
    482481                //Make sure the we are pointing directly to a type
    483482                Type* base = rty->get_base();
    484                 if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( arg, "Mutex argument have exactly one level of indirection " );
    485                 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( 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 " );
    486485
    487486                //Make sure that typed isn't mutex
    488                 if( base->get_mutex() ) throw SemanticError( arg, "mutex keyword may only appear once per argument " );
     487                if( base->get_mutex() ) SemanticError( arg, "mutex keyword may only appear once per argument " );
    489488        }
    490489
     
    624623                if( type && type->get_baseStruct()->is_thread() ) {
    625624                        if( !thread_decl || !thread_ctor_seen ) {
    626                                 throw SemanticError( 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>");
    627626                        }
    628627
Note: See TracChangeset for help on using the changeset viewer.