Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.impl.hpp

    r293dc1c rc6c682cf  
    2020#include <unordered_map>
    2121
    22 #include "AST/TranslationUnit.hpp"
    2322#include "AST/TypeSubstitution.hpp"
    2423
     
    431430        pass_visitor_stats.depth--;
    432431        if ( !errors.isEmpty() ) { throw errors; }
    433 }
    434 
    435 template< typename core_t >
    436 inline void ast::accept_all( ast::TranslationUnit & unit, ast::Pass< core_t > & visitor ) {
    437         return ast::accept_all( unit.decls, visitor );
    438432}
    439433
     
    680674const ast::CompoundStmt * ast::Pass< core_t >::visit( const ast::CompoundStmt * node ) {
    681675        VISIT_START( node );
    682         VISIT(
     676        VISIT({
    683677                // Do not enter (or leave) a new scope if atFunctionTop. Remember to save the result.
    684678                auto guard1 = makeFuncGuard( [this, enterScope = !this->atFunctionTop]() {
     
    687681                        if ( leaveScope ) __pass::symtab::leave(core, 0);
    688682                });
    689                 ValueGuard< bool > guard2( atFunctionTop );
    690                 atFunctionTop = false;
     683                ValueGuard< bool > guard2( inFunction );
    691684                guard_scope guard3 { *this };
     685                inFunction = false;
    692686                maybe_accept( node, &CompoundStmt::kids );
    693         )
     687        })
    694688        VISIT_END( CompoundStmt, node );
    695689}
Note: See TracChangeset for help on using the changeset viewer.