Changes in src/Common/PassVisitor.impl.h [6ca154b:62423350]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.impl.h
r6ca154b r62423350 3 3 #define VISIT_START( node ) \ 4 4 __attribute__((unused)) \ 5 const auto & guard = init_guard();\5 guard_value_impl guard( at_cleanup_impl(pass, 0) ); \ 6 6 bool visit_children = true; \ 7 7 set_visit_children( visit_children ); \ … … 15 15 #define MUTATE_START( node ) \ 16 16 __attribute__((unused)) \ 17 const auto & guard = init_guard();\17 guard_value_impl guard( at_cleanup_impl(pass, 0) ); \ 18 18 bool visit_children = true; \ 19 19 set_visit_children( visit_children ); \ … … 68 68 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 69 69 // splice in new declarations after previous decl 70 if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); } 70 if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); } 71 71 72 72 if ( i == decls.end() ) break; … … 88 88 for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) { 89 89 // splice in new declarations after previous decl 90 if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); } 90 if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); } 91 91 92 92 if ( i == decls.end() ) break; … … 104 104 void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) { 105 105 SemanticError errors; 106 107 // don't want statements from outer CompoundStmts to be added to this CompoundStmt 108 ValueGuardPtr< StmtList_t > oldBeforeStmts( get_beforeStmts() ); 109 ValueGuardPtr< StmtList_t > oldAfterStmts ( get_afterStmts () ); 110 ValueGuardPtr< DeclList_t > oldBeforeDecls( get_beforeDecls() ); 111 ValueGuardPtr< DeclList_t > oldAfterDecls ( get_afterDecls () ); 106 112 107 113 StmtList_t* beforeStmts = get_beforeStmts(); … … 181 187 Statement * PassVisitor< pass_type >::visitStatement( Statement * stmt ) { 182 188 return handleStatement( stmt, [this]( Statement * stmt ) { 183 maybeAccept( stmt, *this ); 189 maybeAccept( stmt, *this ); 184 190 return stmt; 185 191 }); … … 212 218 expr->accept( *this ); 213 219 return expr; 214 }); 220 }); 215 221 } 216 222 … … 565 571 VISIT_START( node ); 566 572 573 // maybeAccept( node->get_env(), *this ); 574 maybeAccept( node->get_result(), *this ); 575 567 576 for ( auto expr : node->get_args() ) { 568 577 visitExpression( expr ); … … 575 584 Expression * PassVisitor< pass_type >::mutate( UntypedExpr * node ) { 576 585 MUTATE_START( node ); 586 587 node->set_env( maybeMutate( node->get_env(), *this ) ); 588 node->set_result( maybeMutate( node->get_result(), *this ) ); 577 589 578 590 for ( auto& expr : node->get_args() ) {
Note:
See TracChangeset
for help on using the changeset viewer.