Changeset 6b224a52 for src/Concurrency


Ignore:
Timestamp:
Aug 25, 2017, 12:11:53 PM (7 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:
bf7b9da7
Parents:
135b431 (diff), f676b84 (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r135b431 r6b224a52  
    2121#include "Common/SemanticError.h"  // for SemanticError
    2222#include "Common/utility.h"        // for deleteAll, map_range
    23 #include "InitTweak/InitTweak.h"   // for isConstructor
     23#include "CodeGen/OperatorTable.h" // for isConstructor
     24#include "InitTweak/InitTweak.h"   // for getPointerBase
    2425#include "Parser/LinkageSpec.h"    // for Cforall
    2526#include "SymTab/AddVisit.h"       // for acceptAndAdd
     
    298299                        LinkageSpec::Cforall,
    299300                        nullptr,
    300                         new PointerType(
     301                        new ReferenceType(
    301302                                noQualifiers,
    302303                                new StructInstType(
     
    455456
    456457                //Makes sure it's not a copy
    457                 PointerType* pty = dynamic_cast< PointerType * >( ty );
    458                 if( ! pty ) throw SemanticError( "Mutex argument must be of pointer/reference type ", arg );
     458                ReferenceType* rty = dynamic_cast< ReferenceType * >( ty );
     459                if( ! rty ) throw SemanticError( "Mutex argument must be of reference type ", arg );
    459460
    460461                //Make sure the we are pointing directly to a type
    461                 Type* base = pty->get_base();
    462                 if(  dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
     462                Type* base = rty->get_base();
     463                if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
     464                if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
    463465
    464466                //Make sure that typed isn't mutex
     
    533535                Visitor::visit(decl);
    534536
    535                 if( ! InitTweak::isConstructor(decl->get_name()) ) return;
     537                if( ! CodeGen::isConstructor(decl->get_name()) ) return;
    536538
    537539                DeclarationWithType * param = decl->get_functionType()->get_parameters().front();
    538                 auto ptr = dynamic_cast< PointerType * >( param->get_type() );
    539                 // if( ptr ) std::cerr << "FRED1" << std::endl;
    540                 auto type  = dynamic_cast< StructInstType * >( ptr->get_base() );
     540                auto type  = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) );
    541541                // if( type ) std::cerr << "FRED2" << std::endl;
    542542                if( type && type->get_baseStruct()->is_thread() ) {
Note: See TracChangeset for help on using the changeset viewer.