Changeset 0ac366b for src/Common
- Timestamp:
- Feb 15, 2018, 11:39:12 AM (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:
- 4a161be
- Parents:
- f5883bd
- Location:
- src/Common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.h
rf5883bd r0ac366b 305 305 void indexerAddUnionFwd ( UnionDecl * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); } 306 306 void indexerAddTrait ( TraitDecl * node ) { indexer_impl_addTrait ( pass, 0, node ); } 307 void indexerAddWith ( std::list< Expression * > & exprs ) { indexer_impl_addWith ( pass, 0, exprs); }307 void indexerAddWith ( std::list< Expression * > & exprs, BaseSyntaxNode * withStmt ) { indexer_impl_addWith ( pass, 0, exprs, withStmt ); } 308 308 309 309 -
src/Common/PassVisitor.impl.h
rf5883bd r0ac366b 398 398 // shadow with exprs and not the other way around. 399 399 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 400 indexerAddWith( node->withExprs );400 indexerAddWith( node->withExprs, node ); 401 401 { 402 402 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); … … 428 428 // shadow with exprs and not the other way around. 429 429 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 430 indexerAddWith( node->withExprs );430 indexerAddWith( node->withExprs, node ); 431 431 { 432 432 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); … … 1069 1069 // catch statements introduce a level of scope (for the caught exception) 1070 1070 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1071 indexerAddWith( node->exprs );1071 indexerAddWith( node->exprs, node ); 1072 1072 maybeAccept_impl( node->stmt, *this ); 1073 1073 } … … 1082 1082 // catch statements introduce a level of scope (for the caught exception) 1083 1083 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1084 indexerAddWith( node->exprs );1084 indexerAddWith( node->exprs, node ); 1085 1085 maybeMutate_impl( node->stmt, *this ); 1086 1086 } -
src/Common/PassVisitor.proto.h
rf5883bd r0ac366b 193 193 194 194 195 #define INDEXER_FUNC ( func, type ) \195 #define INDEXER_FUNC1( func, type ) \ 196 196 template<typename pass_type> \ 197 197 static inline auto indexer_impl_##func ( pass_type & pass, int, type arg ) -> decltype( pass.indexer.func( arg ), void() ) { \ … … 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 , std::list< Expression * > & ); 204 #define INDEXER_FUNC2( func, type1, type2 ) \ 205 template<typename pass_type> \ 206 static inline auto indexer_impl_##func ( pass_type & pass, int, type1 arg1, type2 arg2 ) -> decltype( pass.indexer.func( arg1, arg2 ), void() ) { \ 207 pass.indexer.func( arg1, arg2 ); \ 208 } \ 209 \ 210 template<typename pass_type> \ 211 static inline void indexer_impl_##func ( pass_type &, long, type1, type2 ) { } 212 213 214 INDEXER_FUNC1( addId , DeclarationWithType * ); 215 INDEXER_FUNC1( addType , NamedTypeDecl * ); 216 INDEXER_FUNC1( addStruct , StructDecl * ); 217 INDEXER_FUNC1( addEnum , EnumDecl * ); 218 INDEXER_FUNC1( addUnion , UnionDecl * ); 219 INDEXER_FUNC1( addTrait , TraitDecl * ); 220 INDEXER_FUNC2( addWith , std::list< Expression * > &, BaseSyntaxNode * ); 211 221 212 222
Note: See TracChangeset
for help on using the changeset viewer.