- Timestamp:
- Nov 22, 2017, 4:52:09 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:
- 83882e9
- Parents:
- 452747a
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixInit.cc
r452747a r5fe35d6 943 943 } 944 944 945 void addIds( SymTab::Indexer & indexer, const std::list< DeclarationWithType * > & decls ) {946 for ( auto d : decls ) {947 indexer.addId( d );948 }949 }950 951 void addTypes( SymTab::Indexer & indexer, const std::list< TypeDecl * > & tds ) {952 for ( auto td : tds ) {953 indexer.addType( td );954 addIds( indexer, td->assertions );955 }956 }957 958 945 void GenStructMemberCalls::previsit( FunctionDecl * funcDecl ) { 959 946 GuardValue( function ); … … 1012 999 // need to explicitly re-add function parameters to the indexer in order to resolve copy constructors 1013 1000 auto guard = makeFuncGuard( [this]() { indexer.enterScope(); }, [this]() { indexer.leaveScope(); } ); 1014 addTypes( indexer, function->type->forall ); 1015 addIds( indexer, function->type->returnVals ); 1016 addIds( indexer, function->type->parameters ); 1001 indexer.addFunctionType( function->type ); 1017 1002 1018 1003 // need to iterate through members in reverse in order for … … 1029 1014 // insert and resolve default/copy constructor call for each field that's unhandled 1030 1015 std::list< Statement * > stmt; 1031 Expression * arg2 = 0;1016 Expression * arg2 = nullptr; 1032 1017 if ( isCopyConstructor( function ) ) { 1033 1018 // if copy ctor, need to pass second-param-of-this-function.field -
src/SymTab/Indexer.cc
r452747a r5fe35d6 567 567 } 568 568 569 void Indexer::addIds( const std::list< DeclarationWithType * > & decls ) { 570 for ( auto d : decls ) { 571 addId( d ); 572 } 573 } 574 575 void Indexer::addTypes( const std::list< TypeDecl * > & tds ) { 576 for ( auto td : tds ) { 577 addType( td ); 578 addIds( td->assertions ); 579 } 580 } 581 582 void Indexer::addFunctionType( FunctionType * ftype ) { 583 addTypes( ftype->forall ); 584 addIds( ftype->returnVals ); 585 addIds( ftype->parameters ); 586 } 587 569 588 void Indexer::enterScope() { 570 589 ++scope; -
src/SymTab/Indexer.h
r452747a r5fe35d6 76 76 void addTrait( TraitDecl *decl ); 77 77 78 /// convenience function for adding a list of Ids to the indexer 79 void addIds( const std::list< DeclarationWithType * > & decls ); 80 81 /// convenience function for adding a list of forall parameters to the indexer 82 void addTypes( const std::list< TypeDecl * > & tds ); 83 84 /// convenience function for adding all of the declarations in a function type to the indexer 85 void addFunctionType( FunctionType * ftype ); 86 78 87 bool doDebug = false; ///< Display debugging trace? 79 88 private:
Note: See TracChangeset
for help on using the changeset viewer.