Changeset d3e4d6c for src/Concurrency/Keywords.cc
- Timestamp:
- Aug 23, 2017, 6:22:07 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:
- 87e08e24, cb811ac
- Parents:
- 9f07232 (diff), bd37119 (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
r9f07232 rd3e4d6c 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 … … 289 290 LinkageSpec::Cforall, 290 291 nullptr, 291 new PointerType(292 new ReferenceType( 292 293 noQualifiers, 293 294 new StructInstType( … … 445 446 446 447 //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 );448 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty ); 449 if( ! rty ) throw SemanticError( "Mutex argument must be of reference type ", arg ); 449 450 450 451 //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 ); 452 Type* base = rty->get_base(); 453 if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg ); 454 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg ); 453 455 454 456 //Make sure that typed isn't mutex … … 520 522 Visitor::visit(decl); 521 523 522 if( ! InitTweak::isConstructor(decl->get_name()) ) return;524 if( ! CodeGen::isConstructor(decl->get_name()) ) return; 523 525 524 526 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() ); 527 auto type = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) ); 528 528 // if( type ) std::cerr << "FRED2" << std::endl; 529 529 if( type && type->get_baseStruct()->is_thread() ) {
Note: See TracChangeset
for help on using the changeset viewer.