Changeset dcbb03b for src/SymTab/Indexer.cc
- Timestamp:
- Mar 1, 2018, 9:29:03 AM (6 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:
- 1f37ed02
- Parents:
- b002261 (diff), 446ffa3 (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/SymTab/Indexer.cc
rb002261 rdcbb03b 443 443 // isomorphic to C type-compatibility, which it may not be. 444 444 if ( hasIncompatibleCDecl( name, mangleName, scope ) ) { 445 throwSemanticError( decl, "conflicting overload of C function " );445 SemanticError( decl, "conflicting overload of C function " ); 446 446 } 447 447 } else { 448 448 // Check that a Cforall declaration doesn't override any C declaration 449 449 if ( hasCompatibleCDecl( name, mangleName, scope ) ) { 450 throwSemanticError( decl, "Cforall declaration hides C function " );450 SemanticError( decl, "Cforall declaration hides C function " ); 451 451 } 452 452 } … … 463 463 void Indexer::addId( DeclarationWithType * decl, Expression * baseExpr ) { 464 464 // default handling of conflicts is to raise an error 465 addId( decl, [decl](IdData &, const std::string & msg) { throwSemanticError( decl, msg ); return true; }, baseExpr );465 addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, baseExpr ); 466 466 } 467 467 468 468 void Indexer::addDeletedId( DeclarationWithType * decl, BaseSyntaxNode * deleteStmt ) { 469 469 // default handling of conflicts is to raise an error 470 addId( decl, [decl](IdData &, const std::string & msg) { throwSemanticError( decl, msg ); return true; }, nullptr, deleteStmt );470 addId( decl, [decl](IdData &, const std::string & msg) { SemanticError( decl, msg ); return true; }, nullptr, deleteStmt ); 471 471 } 472 472 … … 477 477 return true; 478 478 } else { 479 throwSemanticError( added, "redeclaration of " );479 SemanticError( added, "redeclaration of " ); 480 480 } 481 481 } … … 504 504 return false; 505 505 } else if ( ! added->get_members().empty() ) { 506 throwSemanticError( added, "redeclaration of " );506 SemanticError( added, "redeclaration of " ); 507 507 } // if 508 508 return true; … … 603 603 if ( dynamic_cast< StructInstType * >( t ) || dynamic_cast< UnionInstType * >( t ) ) { 604 604 Expression * base = expr->clone(); 605 ResolvExpr::referenceToRvalueConversion( base ); 605 ResolvExpr::Cost cost = ResolvExpr::Cost::zero; // xxx - carry this cost into the indexer as a base cost? 606 ResolvExpr::referenceToRvalueConversion( base, cost ); 606 607 addMembers( t->getAggr(), new MemberExpr( dwt, base ), handleConflicts ); 607 608 } … … 705 706 } 706 707 707 Expression * Indexer::IdData::combine( ) const {708 Expression * Indexer::IdData::combine( ResolvExpr::Cost & cost ) const { 708 709 Expression * ret = nullptr; 709 710 if ( baseExpr ) { 710 711 Expression * base = baseExpr->clone(); 711 ResolvExpr::referenceToRvalueConversion( base );712 ResolvExpr::referenceToRvalueConversion( base, cost ); 712 713 ret = new MemberExpr( id, base ); 713 714 // xxx - this introduces hidden environments, for now remove them.
Note: See TracChangeset
for help on using the changeset viewer.