Changeset dcbb03b for src/Concurrency


Ignore:
Timestamp:
Mar 1, 2018, 9:29:03 AM (8 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:
1f37ed02
Parents:
b002261 (diff), 446ffa3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/Concurrency
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    rb002261 rdcbb03b  
    2525#include "InitTweak/InitTweak.h"   // for getPointerBase
    2626#include "Parser/LinkageSpec.h"    // for Cforall
    27 #include "SymTab/AddVisit.h"       // for acceptAndAdd
    2827#include "SynTree/Constant.h"      // for Constant
    2928#include "SynTree/Declaration.h"   // for StructDecl, FunctionDecl, ObjectDecl
     
    281280                if( ! decl->body ) return;
    282281
    283                 if( !type_decl ) throw SemanticError( decl, context_error );
     282                if( !type_decl ) SemanticError( decl, context_error );
    284283
    285284                FunctionDecl * func = forwardDeclare( decl );
     
    418417                if( mutexArgs.empty() ) return;
    419418
    420                 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" );
    421420
    422421                bool isDtor = CodeGen::isDestructor( decl->name );
    423422
    424                 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" );
    425424
    426425                for(auto arg : mutexArgs) {
     
    431430                if( ! body ) return;
    432431
    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>" );
     432                if( !monitor_decl || !guard_decl || !dtor_guard_decl )
     433                        SemanticError( decl, "mutex keyword requires monitors to be in scope, add #include <monitor>" );
    436434
    437435                if( isDtor ) {
     
    479477                //Makes sure it's not a copy
    480478                ReferenceType* rty = dynamic_cast< ReferenceType * >( ty );
    481                 if( ! rty ) throw SemanticError( arg, "Mutex argument must be of reference type " );
     479                if( ! rty ) SemanticError( arg, "Mutex argument must be of reference type " );
    482480
    483481                //Make sure the we are pointing directly to a type
    484482                Type* base = rty->get_base();
    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 " );
     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 " );
    487485
    488486                //Make sure that typed isn't mutex
    489                 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 " );
    490488        }
    491489
     
    625623                if( type && type->get_baseStruct()->is_thread() ) {
    626624                        if( !thread_decl || !thread_ctor_seen ) {
    627                                 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>");
    628626                        }
    629627
  • src/Concurrency/Waitfor.cc

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