Changeset 4670c79
- Timestamp:
- Jan 31, 2018, 4:50:37 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:
- c28a038d
- Parents:
- 574894d
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
r574894d r4670c79 291 291 bool_ref * get_visit_children_ptr() { return visit_children_impl(pass, 0); } 292 292 293 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); }294 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); }295 void indexerAddId ( DeclarationWithType * node) { indexer_impl_addId ( pass, 0, node ); }296 void indexerAddType ( NamedTypeDecl * node) { indexer_impl_addType ( pass, 0, node ); }297 void indexerAddStruct ( const std::string & id) { indexer_impl_addStruct ( pass, 0, id ); }298 void indexerAddStruct ( StructDecl * node) { indexer_impl_addStruct ( pass, 0, node ); }299 void indexerAddStructFwd( StructDecl * node) { indexer_impl_addStructFwd( pass, 0, node ); }300 void indexerAddEnum ( EnumDecl * node) { indexer_impl_addEnum ( pass, 0, node ); }301 void indexerAddUnion ( const std::string & id) { indexer_impl_addUnion ( pass, 0, id ); }302 void indexerAddUnion ( UnionDecl * node) { indexer_impl_addUnion ( pass, 0, node ); }303 void indexerAddUnionFwd ( UnionDecl * node) { indexer_impl_addUnionFwd ( pass, 0, node ); }304 void indexerAddTrait ( TraitDecl * node) { indexer_impl_addTrait ( pass, 0, node ); }305 void indexerAddWith ( WithStmt * node ) { indexer_impl_addWith ( pass, 0, node); }293 void indexerScopeEnter () { indexer_impl_enterScope ( pass, 0 ); } 294 void indexerScopeLeave () { indexer_impl_leaveScope ( pass, 0 ); } 295 void indexerAddId ( DeclarationWithType * node ) { indexer_impl_addId ( pass, 0, node ); } 296 void indexerAddType ( NamedTypeDecl * node ) { indexer_impl_addType ( pass, 0, node ); } 297 void indexerAddStruct ( const std::string & id ) { indexer_impl_addStruct ( pass, 0, id ); } 298 void indexerAddStruct ( StructDecl * node ) { indexer_impl_addStruct ( pass, 0, node ); } 299 void indexerAddStructFwd( StructDecl * node ) { indexer_impl_addStructFwd( pass, 0, node ); } 300 void indexerAddEnum ( EnumDecl * node ) { indexer_impl_addEnum ( pass, 0, node ); } 301 void indexerAddUnion ( const std::string & id ) { indexer_impl_addUnion ( pass, 0, id ); } 302 void indexerAddUnion ( UnionDecl * node ) { indexer_impl_addUnion ( pass, 0, node ); } 303 void indexerAddUnionFwd ( UnionDecl * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); } 304 void indexerAddTrait ( TraitDecl * node ) { indexer_impl_addTrait ( pass, 0, node ); } 305 void indexerAddWith ( std::list< Expression * > & exprs ) { indexer_impl_addWith ( pass, 0, exprs ); } 306 306 307 307 -
src/Common/PassVisitor.impl.h
r574894d r4670c79 994 994 // catch statements introduce a level of scope (for the caught exception) 995 995 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 996 indexerAddWith( node );996 indexerAddWith( node->exprs ); 997 997 maybeAccept_impl( node->stmt, *this ); 998 998 } … … 1007 1007 // catch statements introduce a level of scope (for the caught exception) 1008 1008 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1009 indexerAddWith( node );1009 indexerAddWith( node->exprs ); 1010 1010 maybeMutate_impl( node->stmt, *this ); 1011 1011 } -
src/Common/PassVisitor.proto.h
r574894d r4670c79 202 202 static inline void indexer_impl_##func ( pass_type &, long, type ) { } \ 203 203 204 INDEXER_FUNC( addId , DeclarationWithType * );205 INDEXER_FUNC( addType , NamedTypeDecl * );206 INDEXER_FUNC( addStruct , StructDecl * );207 INDEXER_FUNC( addEnum , EnumDecl * );208 INDEXER_FUNC( addUnion , UnionDecl * );209 INDEXER_FUNC( addTrait , TraitDecl * );210 INDEXER_FUNC( addWith , WithStmt *);204 INDEXER_FUNC( addId , DeclarationWithType * ); 205 INDEXER_FUNC( addType , NamedTypeDecl * ); 206 INDEXER_FUNC( addStruct , StructDecl * ); 207 INDEXER_FUNC( addEnum , EnumDecl * ); 208 INDEXER_FUNC( addUnion , UnionDecl * ); 209 INDEXER_FUNC( addTrait , TraitDecl * ); 210 INDEXER_FUNC( addWith , std::list< Expression * > & ); 211 211 212 212 -
src/SymTab/Indexer.cc
r574894d r4670c79 589 589 } 590 590 591 void Indexer::addWith( WithStmt * stmt) {592 for ( Expression * expr : stmt->exprs ) {591 void Indexer::addWith( std::list< Expression * > & withExprs ) { 592 for ( Expression * expr : withExprs ) { 593 593 if ( expr->result ) { 594 594 AggregateDecl * aggr = expr->result->stripReferences()->getAggr(); -
src/SymTab/Indexer.h
r574894d r4670c79 84 84 85 85 /// adds all of the IDs from WithStmt exprs 86 void addWith( WithStmt *);86 void addWith( std::list< Expression * > & withExprs ); 87 87 88 88 /// adds all of the members of the Aggregate (addWith helper)
Note: See TracChangeset
for help on using the changeset viewer.