Ignore:
File:
1 edited

Legend:

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

    rc6c682cf r293dc1c  
    2020#include <unordered_map>
    2121
     22#include "AST/TranslationUnit.hpp"
    2223#include "AST/TypeSubstitution.hpp"
    2324
     
    430431        pass_visitor_stats.depth--;
    431432        if ( !errors.isEmpty() ) { throw errors; }
     433}
     434
     435template< typename core_t >
     436inline void ast::accept_all( ast::TranslationUnit & unit, ast::Pass< core_t > & visitor ) {
     437        return ast::accept_all( unit.decls, visitor );
    432438}
    433439
     
    674680const ast::CompoundStmt * ast::Pass< core_t >::visit( const ast::CompoundStmt * node ) {
    675681        VISIT_START( node );
    676         VISIT({
     682        VISIT(
    677683                // Do not enter (or leave) a new scope if atFunctionTop. Remember to save the result.
    678684                auto guard1 = makeFuncGuard( [this, enterScope = !this->atFunctionTop]() {
     
    681687                        if ( leaveScope ) __pass::symtab::leave(core, 0);
    682688                });
    683                 ValueGuard< bool > guard2( inFunction );
     689                ValueGuard< bool > guard2( atFunctionTop );
     690                atFunctionTop = false;
    684691                guard_scope guard3 { *this };
    685                 inFunction = false;
    686692                maybe_accept( node, &CompoundStmt::kids );
    687         })
     693        )
    688694        VISIT_END( CompoundStmt, node );
    689695}
Note: See TracChangeset for help on using the changeset viewer.