Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r6b0b624 r83a071f9  
     1//                              -*- Mode: CPP -*-
    12//
    23// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
     
    1112// Last Modified By :
    1213// Last Modified On :
    13 // Update Count     : 5
     14// Update Count     : 3
    1415//
    1516
     
    2122#include "Common/SemanticError.h"  // for SemanticError
    2223#include "Common/utility.h"        // for deleteAll, map_range
    23 #include "InitTweak/InitTweak.h"   // for isConstructor
     24#include "CodeGen/OperatorTable.h" // for isConstructor
     25#include "InitTweak/InitTweak.h"   // for getPointerBase
    2426#include "Parser/LinkageSpec.h"    // for Cforall
    2527#include "SymTab/AddVisit.h"       // for acceptAndAdd
     
    289291                        LinkageSpec::Cforall,
    290292                        nullptr,
    291                         new PointerType(
     293                        new ReferenceType(
    292294                                noQualifiers,
    293295                                new StructInstType(
     
    445447
    446448                //Makes sure it's not a copy
    447                 PointerType* pty = dynamic_cast< PointerType * >( ty );
    448                 if( ! pty ) throw SemanticError( "Mutex argument must be of pointer/reference type ", arg );
     449                ReferenceType* rty = dynamic_cast< ReferenceType * >( ty );
     450                if( ! rty ) throw SemanticError( "Mutex argument must be of reference type ", arg );
    449451
    450452                //Make sure the we are pointing directly to a type
    451                 Type* base = pty->get_base();
    452                 if(  dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
     453                Type* base = rty->get_base();
     454                if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
     455                if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
    453456
    454457                //Make sure that typed isn't mutex
     
    520523                Visitor::visit(decl);
    521524
    522                 if( ! InitTweak::isConstructor(decl->get_name()) ) return;
     525                if( ! CodeGen::isConstructor(decl->get_name()) ) return;
    523526
    524527                DeclarationWithType * param = decl->get_functionType()->get_parameters().front();
    525                 auto ptr = dynamic_cast< PointerType * >( param->get_type() );
    526                 // if( ptr ) std::cerr << "FRED1" << std::endl;
    527                 auto type  = dynamic_cast< StructInstType * >( ptr->get_base() );
     528                auto type  = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) );
    528529                // if( type ) std::cerr << "FRED2" << std::endl;
    529530                if( type && type->get_baseStruct()->is_thread() ) {
     
    548549        }
    549550};
    550 
    551 // Local Variables: //
    552 // mode: c //
    553 // tab-width: 4 //
    554 // End: //
Note: See TracChangeset for help on using the changeset viewer.