Changes in src/Common/PassVisitor.impl.h [61d9b4b:ee3c93d]
- File:
-
- 1 edited
-
src/Common/PassVisitor.impl.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.impl.h
r61d9b4b ree3c93d 404 404 indexerAddId( &func ); 405 405 maybeAccept_impl( node->type, *this ); 406 // function body needs to have the same scope as parameters - CompoundStmt will not enter407 // a new scope if inFunction is true408 ValueGuard< bool > oldInFunction( inFunction );409 inFunction = true;410 406 maybeAccept_impl( node->statements, *this ); 411 407 maybeAccept_impl( node->attributes, *this ); … … 438 434 indexerAddId( &func ); 439 435 maybeMutate_impl( node->type, *this ); 440 // function body needs to have the same scope as parameters - CompoundStmt will not enter441 // a new scope if inFunction is true442 ValueGuard< bool > oldInFunction( inFunction );443 inFunction = true;444 436 maybeMutate_impl( node->statements, *this ); 445 437 maybeMutate_impl( node->attributes, *this ); … … 720 712 VISIT_START( node ); 721 713 { 722 // do not enter a new scope if inFunction is true - needs to check old state before the assignment 723 ValueGuard< bool > oldInFunction( inFunction ); 724 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } ); 714 auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 725 715 auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } ); 726 inFunction = false;727 716 visitStatementList( node->kids ); 728 717 } … … 734 723 MUTATE_START( node ); 735 724 { 736 // do not enter a new scope if inFunction is true - needs to check old state before the assignment 737 ValueGuard< bool > oldInFunction( inFunction ); 738 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } ); 725 auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 739 726 auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } ); 740 inFunction = false;741 727 mutateStatementList( node->kids ); 742 728 } … … 2088 2074 template< typename pass_type > 2089 2075 Expression * PassVisitor< pass_type >::mutate( DeletedExpr * node ) { 2090 MUTATE_START( node );2091 2092 indexerScopedMutate( node->env, *this );2093 indexerScopedMutate( node->result, *this );2094 maybeMutate_impl( node->expr, *this );2095 2096 MUTATE_END( Expression, node );2097 }2098 2099 //--------------------------------------------------------------------------2100 // DefaultArgExpr2101 template< typename pass_type >2102 void PassVisitor< pass_type >::visit( DefaultArgExpr * node ) {2103 VISIT_START( node );2104 2105 indexerScopedAccept( node->result, *this );2106 maybeAccept_impl( node->expr, *this );2107 2108 VISIT_END( node );2109 }2110 2111 template< typename pass_type >2112 Expression * PassVisitor< pass_type >::mutate( DefaultArgExpr * node ) {2113 2076 MUTATE_START( node ); 2114 2077
Note:
See TracChangeset
for help on using the changeset viewer.