Changeset 6b224a52 for src/Concurrency
- Timestamp:
- Aug 25, 2017, 12:11:53 PM (7 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Keywords.cc
r135b431 r6b224a52 21 21 #include "Common/SemanticError.h" // for SemanticError 22 22 #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 24 25 #include "Parser/LinkageSpec.h" // for Cforall 25 26 #include "SymTab/AddVisit.h" // for acceptAndAdd … … 298 299 LinkageSpec::Cforall, 299 300 nullptr, 300 new PointerType(301 new ReferenceType( 301 302 noQualifiers, 302 303 new StructInstType( … … 455 456 456 457 //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 ); 459 460 460 461 //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 ); 463 465 464 466 //Make sure that typed isn't mutex … … 533 535 Visitor::visit(decl); 534 536 535 if( ! InitTweak::isConstructor(decl->get_name()) ) return;537 if( ! CodeGen::isConstructor(decl->get_name()) ) return; 536 538 537 539 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() ) ); 541 541 // if( type ) std::cerr << "FRED2" << std::endl; 542 542 if( type && type->get_baseStruct()->is_thread() ) {
Note: See TracChangeset
for help on using the changeset viewer.