Changes in src/Concurrency/Keywords.cc [6b0b624:83a071f9]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
r6b0b624 r83a071f9 1 // -*- Mode: CPP -*- 1 2 // 2 3 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo … … 11 12 // Last Modified By : 12 13 // Last Modified On : 13 // Update Count : 514 // Update Count : 3 14 15 // 15 16 … … 21 22 #include "Common/SemanticError.h" // for SemanticError 22 23 #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 24 26 #include "Parser/LinkageSpec.h" // for Cforall 25 27 #include "SymTab/AddVisit.h" // for acceptAndAdd … … 289 291 LinkageSpec::Cforall, 290 292 nullptr, 291 new PointerType(293 new ReferenceType( 292 294 noQualifiers, 293 295 new StructInstType( … … 445 447 446 448 //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 ); 449 451 450 452 //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 ); 453 456 454 457 //Make sure that typed isn't mutex … … 520 523 Visitor::visit(decl); 521 524 522 if( ! InitTweak::isConstructor(decl->get_name()) ) return;525 if( ! CodeGen::isConstructor(decl->get_name()) ) return; 523 526 524 527 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() ) ); 528 529 // if( type ) std::cerr << "FRED2" << std::endl; 529 530 if( type && type->get_baseStruct()->is_thread() ) { … … 548 549 } 549 550 }; 550 551 // Local Variables: //552 // mode: c //553 // tab-width: 4 //554 // End: //
Note: See TracChangeset
for help on using the changeset viewer.