Ignore:
Timestamp:
Aug 14, 2020, 11:40:04 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
5715d43, fa5e0112
Parents:
309d814 (diff), badd22f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r309d814 r4c925cd  
    2525        using namespace ast; \
    2626        /* back-up the visit children */ \
    27         __attribute__((unused)) ast::__pass::visit_children_guard guard1( ast::__pass::visit_children(pass, 0) ); \
     27        __attribute__((unused)) ast::__pass::visit_children_guard guard1( ast::__pass::visit_children(core, 0) ); \
    2828        /* setup the scope for passes that want to run code at exit */ \
    29         __attribute__((unused)) ast::__pass::guard_value          guard2( ast::__pass::at_cleanup    (pass, 0) ); \
     29        __attribute__((unused)) ast::__pass::guard_value          guard2( ast::__pass::at_cleanup    (core, 0) ); \
     30        /* begin tracing memory allocation if requested by this pass */ \
     31        __pass::beginTrace( core, 0 ); \
    3032        /* call the implementation of the previsit of this pass */ \
    31         __pass::previsit( pass, node, 0 );
     33        __pass::previsit( core, node, 0 );
    3234
    3335#define VISIT( code... ) \
     
    4042#define VISIT_END( type, node ) \
    4143        /* call the implementation of the postvisit of this pass */ \
    42         auto __return = __pass::postvisit( pass, node, 0 ); \
     44        auto __return = __pass::postvisit( core, node, 0 ); \
    4345        assertf(__return, "post visit should never return null"); \
     46        /* end tracing memory allocation if requested by this pass */ \
     47        __pass::endTrace( core, 0 ); \
    4448        return __return;
    4549
     
    119123        }
    120124
    121         template< typename pass_t >
     125        template< typename core_t >
    122126        template< typename node_t >
    123         auto ast::Pass< pass_t >::call_accept( const node_t * node )
     127        auto ast::Pass< core_t >::call_accept( const node_t * node )
    124128                -> typename std::enable_if<
    125129                                !std::is_base_of<ast::Expr, node_t>::value &&
     
    127131                        , decltype( node->accept(*this) )
    128132                >::type
    129 
    130133        {
    131134                __pedantic_pass_assert( __visit_children() );
    132                 __pedantic_pass_assert( expr );
     135                __pedantic_pass_assert( node );
    133136
    134137                static_assert( !std::is_base_of<ast::Expr, node_t>::value, "ERROR");
     
    138141        }
    139142
    140         template< typename pass_t >
    141         const ast::Expr * ast::Pass< pass_t >::call_accept( const ast::Expr * expr ) {
     143        template< typename core_t >
     144        const ast::Expr * ast::Pass< core_t >::call_accept( const ast::Expr * expr ) {
    142145                __pedantic_pass_assert( __visit_children() );
    143146                __pedantic_pass_assert( expr );
    144147
    145                 const ast::TypeSubstitution ** env_ptr = __pass::env( pass, 0);
     148                const ast::TypeSubstitution ** env_ptr = __pass::env( core, 0);
    146149                if ( env_ptr && expr->env ) {
    147150                        *env_ptr = expr->env;
     
    151154        }
    152155
    153         template< typename pass_t >
    154         const ast::Stmt * ast::Pass< pass_t >::call_accept( const ast::Stmt * stmt ) {
     156        template< typename core_t >
     157        const ast::Stmt * ast::Pass< core_t >::call_accept( const ast::Stmt * stmt ) {
    155158                __pedantic_pass_assert( __visit_children() );
    156159                __pedantic_pass_assert( stmt );
     
    160163
    161164                // get the stmts/decls that will need to be spliced in
    162                 auto stmts_before = __pass::stmtsToAddBefore( pass, 0);
    163                 auto stmts_after  = __pass::stmtsToAddAfter ( pass, 0);
    164                 auto decls_before = __pass::declsToAddBefore( pass, 0);
    165                 auto decls_after  = __pass::declsToAddAfter ( pass, 0);
     165                auto stmts_before = __pass::stmtsToAddBefore( core, 0);
     166                auto stmts_after  = __pass::stmtsToAddAfter ( core, 0);
     167                auto decls_before = __pass::declsToAddBefore( core, 0);
     168                auto decls_after  = __pass::declsToAddAfter ( core, 0);
    166169
    167170                // These may be modified by subnode but most be restored once we exit this statemnet.
    168                 ValueGuardPtr< const ast::TypeSubstitution * > __old_env         ( __pass::env( pass, 0) );
     171                ValueGuardPtr< const ast::TypeSubstitution * > __old_env         ( __pass::env( core, 0) );
    169172                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before );
    170173                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after  );
     
    202205        }
    203206
    204         template< typename pass_t >
     207        template< typename core_t >
    205208        template< template <class...> class container_t >
    206         container_t< ptr<Stmt> > ast::Pass< pass_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {
     209        container_t< ptr<Stmt> > ast::Pass< core_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {
    207210                __pedantic_pass_assert( __visit_children() );
    208211                if( statements.empty() ) return {};
     
    215218
    216219                // get the stmts/decls that will need to be spliced in
    217                 auto stmts_before = __pass::stmtsToAddBefore( pass, 0);
    218                 auto stmts_after  = __pass::stmtsToAddAfter ( pass, 0);
    219                 auto decls_before = __pass::declsToAddBefore( pass, 0);
    220                 auto decls_after  = __pass::declsToAddAfter ( pass, 0);
     220                auto stmts_before = __pass::stmtsToAddBefore( core, 0);
     221                auto stmts_after  = __pass::stmtsToAddAfter ( core, 0);
     222                auto decls_before = __pass::declsToAddBefore( core, 0);
     223                auto decls_after  = __pass::declsToAddAfter ( core, 0);
    221224
    222225                // These may be modified by subnode but most be restored once we exit this statemnet.
     
    268271        }
    269272
    270         template< typename pass_t >
     273        template< typename core_t >
    271274        template< template <class...> class container_t, typename node_t >
    272         container_t< ast::ptr<node_t> > ast::Pass< pass_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {
     275        container_t< ast::ptr<node_t> > ast::Pass< core_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {
    273276                __pedantic_pass_assert( __visit_children() );
    274277                if( container.empty() ) return {};
     
    299302        }
    300303
    301         template< typename pass_t >
     304        template< typename core_t >
    302305        template<typename node_t, typename parent_t, typename child_t>
    303         void ast::Pass< pass_t >::maybe_accept(
     306        void ast::Pass< core_t >::maybe_accept(
    304307                const node_t * & parent,
    305308                child_t parent_t::*child
     
    323326        }
    324327
     328
     329        template< typename core_t >
     330        template< typename node_t >
     331        void ast::Pass< core_t >::mutate_forall( const node_t *& node ) {
     332                if ( auto subs = __pass::forall::subs( core, 0 ) ) {
     333                        // tracking TypeDecl substitution, full clone
     334                        if ( node->forall.empty() ) return;
     335
     336                        node_t * mut = mutate( node );
     337                        mut->forall = subs->clone( node->forall, *this );
     338                        node = mut;
     339                } else {
     340                        // not tracking TypeDecl substitution, just mutate
     341                        maybe_accept( node, &node_t::forall );
     342                }
     343        }
    325344}
    326345
     
    333352//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    334353
    335 template< typename pass_t >
    336 inline void ast::accept_all( std::list< ast::ptr<ast::Decl> > & decls, ast::Pass< pass_t > & visitor ) {
     354template< typename core_t >
     355inline void ast::accept_all( std::list< ast::ptr<ast::Decl> > & decls, ast::Pass< core_t > & visitor ) {
    337356        // We are going to aggregate errors for all these statements
    338357        SemanticErrorException errors;
     
    342361
    343362        // get the stmts/decls that will need to be spliced in
    344         auto decls_before = __pass::declsToAddBefore( visitor.pass, 0);
    345         auto decls_after  = __pass::declsToAddAfter ( visitor.pass, 0);
     363        auto decls_before = __pass::declsToAddBefore( visitor.core, 0);
     364        auto decls_after  = __pass::declsToAddAfter ( visitor.core, 0);
    346365
    347366        // update pass statitistics
     
    392411//--------------------------------------------------------------------------
    393412// ObjectDecl
    394 template< typename pass_t >
    395 const ast::DeclWithType * ast::Pass< pass_t >::visit( const ast::ObjectDecl * node ) {
     413template< typename core_t >
     414const ast::DeclWithType * ast::Pass< core_t >::visit( const ast::ObjectDecl * node ) {
    396415        VISIT_START( node );
    397416
     
    406425        )
    407426
    408         __pass::symtab::addId( pass, 0, node );
     427        __pass::symtab::addId( core, 0, node );
    409428
    410429        VISIT_END( DeclWithType, node );
     
    413432//--------------------------------------------------------------------------
    414433// FunctionDecl
    415 template< typename pass_t >
    416 const ast::DeclWithType * ast::Pass< pass_t >::visit( const ast::FunctionDecl * node ) {
    417         VISIT_START( node );
    418 
    419         __pass::symtab::addId( pass, 0, node );
     434template< typename core_t >
     435const ast::DeclWithType * ast::Pass< core_t >::visit( const ast::FunctionDecl * node ) {
     436        VISIT_START( node );
     437
     438        __pass::symtab::addId( core, 0, node );
    420439
    421440        VISIT(maybe_accept( node, &FunctionDecl::withExprs );)
     
    425444                // shadow with exprs and not the other way around.
    426445                guard_symtab guard { *this };
    427                 __pass::symtab::addWith( pass, 0, node->withExprs, node );
     446                __pass::symtab::addWith( core, 0, node->withExprs, node );
    428447                {
    429448                        guard_symtab guard { *this };
    430449                        // implicit add __func__ identifier as specified in the C manual 6.4.2.2
    431                         static ast::ObjectDecl func(
    432                                 node->location, "__func__",
    433                                 new ast::ArrayType(
    434                                         new ast::BasicType( ast::BasicType::Char, ast::CV::Qualifiers( ast::CV::Const ) ),
     450                        static ast::ptr< ast::ObjectDecl > func{ new ast::ObjectDecl{
     451                                CodeLocation{}, "__func__",
     452                                new ast::ArrayType{
     453                                        new ast::BasicType{ ast::BasicType::Char, ast::CV::Const },
    435454                                        nullptr, VariableLen, DynamicDim
    436                                 )
    437                         );
    438                         __pass::symtab::addId( pass, 0, &func );
     455                                }
     456                        } };
     457                        __pass::symtab::addId( core, 0, func );
    439458                        VISIT(
    440459                                maybe_accept( node, &FunctionDecl::type );
     
    454473//--------------------------------------------------------------------------
    455474// StructDecl
    456 template< typename pass_t >
    457 const ast::Decl * ast::Pass< pass_t >::visit( const ast::StructDecl * node ) {
     475template< typename core_t >
     476const ast::Decl * ast::Pass< core_t >::visit( const ast::StructDecl * node ) {
    458477        VISIT_START( node );
    459478
    460479        // make up a forward declaration and add it before processing the members
    461480        // needs to be on the heap because addStruct saves the pointer
    462         __pass::symtab::addStructFwd( pass, 0, node );
     481        __pass::symtab::addStructFwd( core, 0, node );
    463482
    464483        VISIT({
     
    469488
    470489        // this addition replaces the forward declaration
    471         __pass::symtab::addStruct( pass, 0, node );
     490        __pass::symtab::addStruct( core, 0, node );
    472491
    473492        VISIT_END( Decl, node );
     
    476495//--------------------------------------------------------------------------
    477496// UnionDecl
    478 template< typename pass_t >
    479 const ast::Decl * ast::Pass< pass_t >::visit( const ast::UnionDecl * node ) {
     497template< typename core_t >
     498const ast::Decl * ast::Pass< core_t >::visit( const ast::UnionDecl * node ) {
    480499        VISIT_START( node );
    481500
    482501        // make up a forward declaration and add it before processing the members
    483         __pass::symtab::addUnionFwd( pass, 0, node );
     502        __pass::symtab::addUnionFwd( core, 0, node );
    484503
    485504        VISIT({
     
    489508        })
    490509
    491         __pass::symtab::addUnion( pass, 0, node );
     510        __pass::symtab::addUnion( core, 0, node );
    492511
    493512        VISIT_END( Decl, node );
     
    496515//--------------------------------------------------------------------------
    497516// EnumDecl
    498 template< typename pass_t >
    499 const ast::Decl * ast::Pass< pass_t >::visit( const ast::EnumDecl * node ) {
    500         VISIT_START( node );
    501 
    502         __pass::symtab::addEnum( pass, 0, node );
     517template< typename core_t >
     518const ast::Decl * ast::Pass< core_t >::visit( const ast::EnumDecl * node ) {
     519        VISIT_START( node );
     520
     521        __pass::symtab::addEnum( core, 0, node );
    503522
    504523        VISIT(
     
    513532//--------------------------------------------------------------------------
    514533// TraitDecl
    515 template< typename pass_t >
    516 const ast::Decl * ast::Pass< pass_t >::visit( const ast::TraitDecl * node ) {
     534template< typename core_t >
     535const ast::Decl * ast::Pass< core_t >::visit( const ast::TraitDecl * node ) {
    517536        VISIT_START( node );
    518537
     
    523542        })
    524543
    525         __pass::symtab::addTrait( pass, 0, node );
     544        __pass::symtab::addTrait( core, 0, node );
    526545
    527546        VISIT_END( Decl, node );
     
    530549//--------------------------------------------------------------------------
    531550// TypeDecl
    532 template< typename pass_t >
    533 const ast::Decl * ast::Pass< pass_t >::visit( const ast::TypeDecl * node ) {
     551template< typename core_t >
     552const ast::Decl * ast::Pass< core_t >::visit( const ast::TypeDecl * node ) {
    534553        VISIT_START( node );
    535554
     
    543562        // note that assertions come after the type is added to the symtab, since they are not part of the type proper
    544563        // and may depend on the type itself
    545         __pass::symtab::addType( pass, 0, node );
     564        __pass::symtab::addType( core, 0, node );
    546565
    547566        VISIT(
     
    559578//--------------------------------------------------------------------------
    560579// TypedefDecl
    561 template< typename pass_t >
    562 const ast::Decl * ast::Pass< pass_t >::visit( const ast::TypedefDecl * node ) {
     580template< typename core_t >
     581const ast::Decl * ast::Pass< core_t >::visit( const ast::TypedefDecl * node ) {
    563582        VISIT_START( node );
    564583
     
    569588        })
    570589
    571         __pass::symtab::addType( pass, 0, node );
     590        __pass::symtab::addType( core, 0, node );
    572591
    573592        VISIT( maybe_accept( node, &TypedefDecl::assertions ); )
     
    578597//--------------------------------------------------------------------------
    579598// AsmDecl
    580 template< typename pass_t >
    581 const ast::AsmDecl * ast::Pass< pass_t >::visit( const ast::AsmDecl * node ) {
     599template< typename core_t >
     600const ast::AsmDecl * ast::Pass< core_t >::visit( const ast::AsmDecl * node ) {
    582601        VISIT_START( node );
    583602
     
    591610//--------------------------------------------------------------------------
    592611// StaticAssertDecl
    593 template< typename pass_t >
    594 const ast::StaticAssertDecl * ast::Pass< pass_t >::visit( const ast::StaticAssertDecl * node ) {
     612template< typename core_t >
     613const ast::StaticAssertDecl * ast::Pass< core_t >::visit( const ast::StaticAssertDecl * node ) {
    595614        VISIT_START( node );
    596615
     
    605624//--------------------------------------------------------------------------
    606625// CompoundStmt
    607 template< typename pass_t >
    608 const ast::CompoundStmt * ast::Pass< pass_t >::visit( const ast::CompoundStmt * node ) {
     626template< typename core_t >
     627const ast::CompoundStmt * ast::Pass< core_t >::visit( const ast::CompoundStmt * node ) {
    609628        VISIT_START( node );
    610629        VISIT({
    611630                // do not enter a new scope if inFunction is true - needs to check old state before the assignment
    612                 auto guard1 = makeFuncGuard( [this, inFunction = this->inFunction]() {
    613                         if ( ! inFunction ) __pass::symtab::enter(pass, 0);
    614                 }, [this, inFunction = this->inFunction]() {
    615                         if ( ! inFunction ) __pass::symtab::leave(pass, 0);
     631                auto guard1 = makeFuncGuard( [this, inFunctionCpy = this->inFunction]() {
     632                        if ( ! inFunctionCpy ) __pass::symtab::enter(core, 0);
     633                }, [this, inFunctionCpy = this->inFunction]() {
     634                        if ( ! inFunctionCpy ) __pass::symtab::leave(core, 0);
    616635                });
    617636                ValueGuard< bool > guard2( inFunction );
     
    625644//--------------------------------------------------------------------------
    626645// ExprStmt
    627 template< typename pass_t >
    628 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ExprStmt * node ) {
     646template< typename core_t >
     647const ast::Stmt * ast::Pass< core_t >::visit( const ast::ExprStmt * node ) {
    629648        VISIT_START( node );
    630649
     
    638657//--------------------------------------------------------------------------
    639658// AsmStmt
    640 template< typename pass_t >
    641 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::AsmStmt * node ) {
     659template< typename core_t >
     660const ast::Stmt * ast::Pass< core_t >::visit( const ast::AsmStmt * node ) {
    642661        VISIT_START( node )
    643662
     
    654673//--------------------------------------------------------------------------
    655674// DirectiveStmt
    656 template< typename pass_t >
    657 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::DirectiveStmt * node ) {
     675template< typename core_t >
     676const ast::Stmt * ast::Pass< core_t >::visit( const ast::DirectiveStmt * node ) {
    658677        VISIT_START( node )
    659678
     
    663682//--------------------------------------------------------------------------
    664683// IfStmt
    665 template< typename pass_t >
    666 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::IfStmt * node ) {
     684template< typename core_t >
     685const ast::Stmt * ast::Pass< core_t >::visit( const ast::IfStmt * node ) {
    667686        VISIT_START( node );
    668687
     
    681700//--------------------------------------------------------------------------
    682701// WhileStmt
    683 template< typename pass_t >
    684 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::WhileStmt * node ) {
     702template< typename core_t >
     703const ast::Stmt * ast::Pass< core_t >::visit( const ast::WhileStmt * node ) {
    685704        VISIT_START( node );
    686705
     
    698717//--------------------------------------------------------------------------
    699718// ForStmt
    700 template< typename pass_t >
    701 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ForStmt * node ) {
     719template< typename core_t >
     720const ast::Stmt * ast::Pass< core_t >::visit( const ast::ForStmt * node ) {
    702721        VISIT_START( node );
    703722
     
    716735//--------------------------------------------------------------------------
    717736// SwitchStmt
    718 template< typename pass_t >
    719 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::SwitchStmt * node ) {
     737template< typename core_t >
     738const ast::Stmt * ast::Pass< core_t >::visit( const ast::SwitchStmt * node ) {
    720739        VISIT_START( node );
    721740
     
    730749//--------------------------------------------------------------------------
    731750// CaseStmt
    732 template< typename pass_t >
    733 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::CaseStmt * node ) {
     751template< typename core_t >
     752const ast::Stmt * ast::Pass< core_t >::visit( const ast::CaseStmt * node ) {
    734753        VISIT_START( node );
    735754
     
    744763//--------------------------------------------------------------------------
    745764// BranchStmt
    746 template< typename pass_t >
    747 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::BranchStmt * node ) {
     765template< typename core_t >
     766const ast::Stmt * ast::Pass< core_t >::visit( const ast::BranchStmt * node ) {
    748767        VISIT_START( node );
    749768        VISIT_END( Stmt, node );
     
    752771//--------------------------------------------------------------------------
    753772// ReturnStmt
    754 template< typename pass_t >
    755 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ReturnStmt * node ) {
     773template< typename core_t >
     774const ast::Stmt * ast::Pass< core_t >::visit( const ast::ReturnStmt * node ) {
    756775        VISIT_START( node );
    757776
     
    765784//--------------------------------------------------------------------------
    766785// ThrowStmt
    767 template< typename pass_t >
    768 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ThrowStmt * node ) {
     786template< typename core_t >
     787const ast::Stmt * ast::Pass< core_t >::visit( const ast::ThrowStmt * node ) {
    769788        VISIT_START( node );
    770789
     
    779798//--------------------------------------------------------------------------
    780799// TryStmt
    781 template< typename pass_t >
    782 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::TryStmt * node ) {
     800template< typename core_t >
     801const ast::Stmt * ast::Pass< core_t >::visit( const ast::TryStmt * node ) {
    783802        VISIT_START( node );
    784803
     
    794813//--------------------------------------------------------------------------
    795814// CatchStmt
    796 template< typename pass_t >
    797 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::CatchStmt * node ) {
     815template< typename core_t >
     816const ast::Stmt * ast::Pass< core_t >::visit( const ast::CatchStmt * node ) {
    798817        VISIT_START( node );
    799818
     
    811830//--------------------------------------------------------------------------
    812831// FinallyStmt
    813 template< typename pass_t >
    814 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::FinallyStmt * node ) {
     832template< typename core_t >
     833const ast::Stmt * ast::Pass< core_t >::visit( const ast::FinallyStmt * node ) {
    815834        VISIT_START( node );
    816835
     
    824843//--------------------------------------------------------------------------
    825844// FinallyStmt
    826 template< typename pass_t >
    827 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::SuspendStmt * node ) {
     845template< typename core_t >
     846const ast::Stmt * ast::Pass< core_t >::visit( const ast::SuspendStmt * node ) {
    828847        VISIT_START( node );
    829848
     
    837856//--------------------------------------------------------------------------
    838857// WaitForStmt
    839 template< typename pass_t >
    840 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::WaitForStmt * node ) {
     858template< typename core_t >
     859const ast::Stmt * ast::Pass< core_t >::visit( const ast::WaitForStmt * node ) {
    841860        VISIT_START( node );
    842861                // for( auto & clause : node->clauses ) {
     
    906925//--------------------------------------------------------------------------
    907926// WithStmt
    908 template< typename pass_t >
    909 const ast::Decl * ast::Pass< pass_t >::visit( const ast::WithStmt * node ) {
     927template< typename core_t >
     928const ast::Decl * ast::Pass< core_t >::visit( const ast::WithStmt * node ) {
    910929        VISIT_START( node );
    911930
     
    915934                        // catch statements introduce a level of scope (for the caught exception)
    916935                        guard_symtab guard { *this };
    917                         __pass::symtab::addWith( pass, 0, node->exprs, node );
     936                        __pass::symtab::addWith( core, 0, node->exprs, node );
    918937                        maybe_accept( node, &WithStmt::stmt );
    919938                }
     
    924943//--------------------------------------------------------------------------
    925944// NullStmt
    926 template< typename pass_t >
    927 const ast::NullStmt * ast::Pass< pass_t >::visit( const ast::NullStmt * node ) {
     945template< typename core_t >
     946const ast::NullStmt * ast::Pass< core_t >::visit( const ast::NullStmt * node ) {
    928947        VISIT_START( node );
    929948        VISIT_END( NullStmt, node );
     
    932951//--------------------------------------------------------------------------
    933952// DeclStmt
    934 template< typename pass_t >
    935 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::DeclStmt * node ) {
     953template< typename core_t >
     954const ast::Stmt * ast::Pass< core_t >::visit( const ast::DeclStmt * node ) {
    936955        VISIT_START( node );
    937956
     
    945964//--------------------------------------------------------------------------
    946965// ImplicitCtorDtorStmt
    947 template< typename pass_t >
    948 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ImplicitCtorDtorStmt * node ) {
     966template< typename core_t >
     967const ast::Stmt * ast::Pass< core_t >::visit( const ast::ImplicitCtorDtorStmt * node ) {
    949968        VISIT_START( node );
    950969
    951970        // For now this isn't visited, it is unclear if this causes problem
    952971        // if all tests are known to pass, remove this code
    953         // VISIT(
    954         //      maybe_accept( node, &ImplicitCtorDtorStmt::callStmt );
    955         // )
     972        VISIT(
     973                maybe_accept( node, &ImplicitCtorDtorStmt::callStmt );
     974        )
    956975
    957976        VISIT_END( Stmt, node );
     
    960979//--------------------------------------------------------------------------
    961980// ApplicationExpr
    962 template< typename pass_t >
    963 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ApplicationExpr * node ) {
     981template< typename core_t >
     982const ast::Expr * ast::Pass< core_t >::visit( const ast::ApplicationExpr * node ) {
    964983        VISIT_START( node );
    965984
     
    978997//--------------------------------------------------------------------------
    979998// UntypedExpr
    980 template< typename pass_t >
    981 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedExpr * node ) {
     999template< typename core_t >
     1000const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedExpr * node ) {
    9821001        VISIT_START( node );
    9831002
     
    9961015//--------------------------------------------------------------------------
    9971016// NameExpr
    998 template< typename pass_t >
    999 const ast::Expr * ast::Pass< pass_t >::visit( const ast::NameExpr * node ) {
     1017template< typename core_t >
     1018const ast::Expr * ast::Pass< core_t >::visit( const ast::NameExpr * node ) {
    10001019        VISIT_START( node );
    10011020
     
    10101029//--------------------------------------------------------------------------
    10111030// CastExpr
    1012 template< typename pass_t >
    1013 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CastExpr * node ) {
     1031template< typename core_t >
     1032const ast::Expr * ast::Pass< core_t >::visit( const ast::CastExpr * node ) {
    10141033        VISIT_START( node );
    10151034
     
    10261045//--------------------------------------------------------------------------
    10271046// KeywordCastExpr
    1028 template< typename pass_t >
    1029 const ast::Expr * ast::Pass< pass_t >::visit( const ast::KeywordCastExpr * node ) {
     1047template< typename core_t >
     1048const ast::Expr * ast::Pass< core_t >::visit( const ast::KeywordCastExpr * node ) {
    10301049        VISIT_START( node );
    10311050
     
    10421061//--------------------------------------------------------------------------
    10431062// VirtualCastExpr
    1044 template< typename pass_t >
    1045 const ast::Expr * ast::Pass< pass_t >::visit( const ast::VirtualCastExpr * node ) {
     1063template< typename core_t >
     1064const ast::Expr * ast::Pass< core_t >::visit( const ast::VirtualCastExpr * node ) {
    10461065        VISIT_START( node );
    10471066
     
    10581077//--------------------------------------------------------------------------
    10591078// AddressExpr
    1060 template< typename pass_t >
    1061 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AddressExpr * node ) {
     1079template< typename core_t >
     1080const ast::Expr * ast::Pass< core_t >::visit( const ast::AddressExpr * node ) {
    10621081        VISIT_START( node );
    10631082
     
    10741093//--------------------------------------------------------------------------
    10751094// LabelAddressExpr
    1076 template< typename pass_t >
    1077 const ast::Expr * ast::Pass< pass_t >::visit( const ast::LabelAddressExpr * node ) {
     1095template< typename core_t >
     1096const ast::Expr * ast::Pass< core_t >::visit( const ast::LabelAddressExpr * node ) {
    10781097        VISIT_START( node );
    10791098
     
    10881107//--------------------------------------------------------------------------
    10891108// UntypedMemberExpr
    1090 template< typename pass_t >
    1091 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedMemberExpr * node ) {
     1109template< typename core_t >
     1110const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedMemberExpr * node ) {
    10921111        VISIT_START( node );
    10931112
     
    11051124//--------------------------------------------------------------------------
    11061125// MemberExpr
    1107 template< typename pass_t >
    1108 const ast::Expr * ast::Pass< pass_t >::visit( const ast::MemberExpr * node ) {
     1126template< typename core_t >
     1127const ast::Expr * ast::Pass< core_t >::visit( const ast::MemberExpr * node ) {
    11091128        VISIT_START( node );
    11101129
     
    11211140//--------------------------------------------------------------------------
    11221141// VariableExpr
    1123 template< typename pass_t >
    1124 const ast::Expr * ast::Pass< pass_t >::visit( const ast::VariableExpr * node ) {
     1142template< typename core_t >
     1143const ast::Expr * ast::Pass< core_t >::visit( const ast::VariableExpr * node ) {
    11251144        VISIT_START( node );
    11261145
     
    11351154//--------------------------------------------------------------------------
    11361155// ConstantExpr
    1137 template< typename pass_t >
    1138 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstantExpr * node ) {
     1156template< typename core_t >
     1157const ast::Expr * ast::Pass< core_t >::visit( const ast::ConstantExpr * node ) {
    11391158        VISIT_START( node );
    11401159
     
    11491168//--------------------------------------------------------------------------
    11501169// SizeofExpr
    1151 template< typename pass_t >
    1152 const ast::Expr * ast::Pass< pass_t >::visit( const ast::SizeofExpr * node ) {
     1170template< typename core_t >
     1171const ast::Expr * ast::Pass< core_t >::visit( const ast::SizeofExpr * node ) {
    11531172        VISIT_START( node );
    11541173
     
    11691188//--------------------------------------------------------------------------
    11701189// AlignofExpr
    1171 template< typename pass_t >
    1172 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AlignofExpr * node ) {
     1190template< typename core_t >
     1191const ast::Expr * ast::Pass< core_t >::visit( const ast::AlignofExpr * node ) {
    11731192        VISIT_START( node );
    11741193
     
    11891208//--------------------------------------------------------------------------
    11901209// UntypedOffsetofExpr
    1191 template< typename pass_t >
    1192 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedOffsetofExpr * node ) {
     1210template< typename core_t >
     1211const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedOffsetofExpr * node ) {
    11931212        VISIT_START( node );
    11941213
     
    12051224//--------------------------------------------------------------------------
    12061225// OffsetofExpr
    1207 template< typename pass_t >
    1208 const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetofExpr * node ) {
     1226template< typename core_t >
     1227const ast::Expr * ast::Pass< core_t >::visit( const ast::OffsetofExpr * node ) {
    12091228        VISIT_START( node );
    12101229
     
    12211240//--------------------------------------------------------------------------
    12221241// OffsetPackExpr
    1223 template< typename pass_t >
    1224 const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetPackExpr * node ) {
     1242template< typename core_t >
     1243const ast::Expr * ast::Pass< core_t >::visit( const ast::OffsetPackExpr * node ) {
    12251244        VISIT_START( node );
    12261245
     
    12371256//--------------------------------------------------------------------------
    12381257// LogicalExpr
    1239 template< typename pass_t >
    1240 const ast::Expr * ast::Pass< pass_t >::visit( const ast::LogicalExpr * node ) {
     1258template< typename core_t >
     1259const ast::Expr * ast::Pass< core_t >::visit( const ast::LogicalExpr * node ) {
    12411260        VISIT_START( node );
    12421261
     
    12541273//--------------------------------------------------------------------------
    12551274// ConditionalExpr
    1256 template< typename pass_t >
    1257 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConditionalExpr * node ) {
     1275template< typename core_t >
     1276const ast::Expr * ast::Pass< core_t >::visit( const ast::ConditionalExpr * node ) {
    12581277        VISIT_START( node );
    12591278
     
    12721291//--------------------------------------------------------------------------
    12731292// CommaExpr
    1274 template< typename pass_t >
    1275 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CommaExpr * node ) {
     1293template< typename core_t >
     1294const ast::Expr * ast::Pass< core_t >::visit( const ast::CommaExpr * node ) {
    12761295        VISIT_START( node );
    12771296
     
    12891308//--------------------------------------------------------------------------
    12901309// TypeExpr
    1291 template< typename pass_t >
    1292 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TypeExpr * node ) {
     1310template< typename core_t >
     1311const ast::Expr * ast::Pass< core_t >::visit( const ast::TypeExpr * node ) {
    12931312        VISIT_START( node );
    12941313
     
    13051324//--------------------------------------------------------------------------
    13061325// AsmExpr
    1307 template< typename pass_t >
    1308 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AsmExpr * node ) {
     1326template< typename core_t >
     1327const ast::Expr * ast::Pass< core_t >::visit( const ast::AsmExpr * node ) {
    13091328        VISIT_START( node );
    13101329
     
    13221341//--------------------------------------------------------------------------
    13231342// ImplicitCopyCtorExpr
    1324 template< typename pass_t >
    1325 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ImplicitCopyCtorExpr * node ) {
     1343template< typename core_t >
     1344const ast::Expr * ast::Pass< core_t >::visit( const ast::ImplicitCopyCtorExpr * node ) {
    13261345        VISIT_START( node );
    13271346
     
    13381357//--------------------------------------------------------------------------
    13391358// ConstructorExpr
    1340 template< typename pass_t >
    1341 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstructorExpr * node ) {
     1359template< typename core_t >
     1360const ast::Expr * ast::Pass< core_t >::visit( const ast::ConstructorExpr * node ) {
    13421361        VISIT_START( node );
    13431362
     
    13541373//--------------------------------------------------------------------------
    13551374// CompoundLiteralExpr
    1356 template< typename pass_t >
    1357 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CompoundLiteralExpr * node ) {
     1375template< typename core_t >
     1376const ast::Expr * ast::Pass< core_t >::visit( const ast::CompoundLiteralExpr * node ) {
    13581377        VISIT_START( node );
    13591378
     
    13701389//--------------------------------------------------------------------------
    13711390// RangeExpr
    1372 template< typename pass_t >
    1373 const ast::Expr * ast::Pass< pass_t >::visit( const ast::RangeExpr * node ) {
     1391template< typename core_t >
     1392const ast::Expr * ast::Pass< core_t >::visit( const ast::RangeExpr * node ) {
    13741393        VISIT_START( node );
    13751394
     
    13871406//--------------------------------------------------------------------------
    13881407// UntypedTupleExpr
    1389 template< typename pass_t >
    1390 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedTupleExpr * node ) {
     1408template< typename core_t >
     1409const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedTupleExpr * node ) {
    13911410        VISIT_START( node );
    13921411
     
    14031422//--------------------------------------------------------------------------
    14041423// TupleExpr
    1405 template< typename pass_t >
    1406 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleExpr * node ) {
     1424template< typename core_t >
     1425const ast::Expr * ast::Pass< core_t >::visit( const ast::TupleExpr * node ) {
    14071426        VISIT_START( node );
    14081427
     
    14191438//--------------------------------------------------------------------------
    14201439// TupleIndexExpr
    1421 template< typename pass_t >
    1422 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleIndexExpr * node ) {
     1440template< typename core_t >
     1441const ast::Expr * ast::Pass< core_t >::visit( const ast::TupleIndexExpr * node ) {
    14231442        VISIT_START( node );
    14241443
     
    14351454//--------------------------------------------------------------------------
    14361455// TupleAssignExpr
    1437 template< typename pass_t >
    1438 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleAssignExpr * node ) {
     1456template< typename core_t >
     1457const ast::Expr * ast::Pass< core_t >::visit( const ast::TupleAssignExpr * node ) {
    14391458        VISIT_START( node );
    14401459
     
    14511470//--------------------------------------------------------------------------
    14521471// StmtExpr
    1453 template< typename pass_t >
    1454 const ast::Expr * ast::Pass< pass_t >::visit( const ast::StmtExpr * node ) {
     1472template< typename core_t >
     1473const ast::Expr * ast::Pass< core_t >::visit( const ast::StmtExpr * node ) {
    14551474        VISIT_START( node );
    14561475
    14571476        VISIT(// don't want statements from outer CompoundStmts to be added to this StmtExpr
    14581477                // get the stmts that will need to be spliced in
    1459                 auto stmts_before = __pass::stmtsToAddBefore( pass, 0);
    1460                 auto stmts_after  = __pass::stmtsToAddAfter ( pass, 0);
     1478                auto stmts_before = __pass::stmtsToAddBefore( core, 0);
     1479                auto stmts_after  = __pass::stmtsToAddAfter ( core, 0);
    14611480
    14621481                // These may be modified by subnode but most be restored once we exit this statemnet.
    1463                 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::env( pass, 0) );
     1482                ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::env( core, 0) );
    14641483                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before );
    14651484                ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after  );
     
    14791498//--------------------------------------------------------------------------
    14801499// UniqueExpr
    1481 template< typename pass_t >
    1482 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UniqueExpr * node ) {
     1500template< typename core_t >
     1501const ast::Expr * ast::Pass< core_t >::visit( const ast::UniqueExpr * node ) {
    14831502        VISIT_START( node );
    14841503
     
    14951514//--------------------------------------------------------------------------
    14961515// UntypedInitExpr
    1497 template< typename pass_t >
    1498 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedInitExpr * node ) {
     1516template< typename core_t >
     1517const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedInitExpr * node ) {
    14991518        VISIT_START( node );
    15001519
     
    15121531//--------------------------------------------------------------------------
    15131532// InitExpr
    1514 template< typename pass_t >
    1515 const ast::Expr * ast::Pass< pass_t >::visit( const ast::InitExpr * node ) {
     1533template< typename core_t >
     1534const ast::Expr * ast::Pass< core_t >::visit( const ast::InitExpr * node ) {
    15161535        VISIT_START( node );
    15171536
     
    15291548//--------------------------------------------------------------------------
    15301549// DeletedExpr
    1531 template< typename pass_t >
    1532 const ast::Expr * ast::Pass< pass_t >::visit( const ast::DeletedExpr * node ) {
     1550template< typename core_t >
     1551const ast::Expr * ast::Pass< core_t >::visit( const ast::DeletedExpr * node ) {
    15331552        VISIT_START( node );
    15341553
     
    15461565//--------------------------------------------------------------------------
    15471566// DefaultArgExpr
    1548 template< typename pass_t >
    1549 const ast::Expr * ast::Pass< pass_t >::visit( const ast::DefaultArgExpr * node ) {
     1567template< typename core_t >
     1568const ast::Expr * ast::Pass< core_t >::visit( const ast::DefaultArgExpr * node ) {
    15501569        VISIT_START( node );
    15511570
     
    15621581//--------------------------------------------------------------------------
    15631582// GenericExpr
    1564 template< typename pass_t >
    1565 const ast::Expr * ast::Pass< pass_t >::visit( const ast::GenericExpr * node ) {
     1583template< typename core_t >
     1584const ast::Expr * ast::Pass< core_t >::visit( const ast::GenericExpr * node ) {
    15661585        VISIT_START( node );
    15671586
     
    16021621//--------------------------------------------------------------------------
    16031622// VoidType
    1604 template< typename pass_t >
    1605 const ast::Type * ast::Pass< pass_t >::visit( const ast::VoidType * node ) {
     1623template< typename core_t >
     1624const ast::Type * ast::Pass< core_t >::visit( const ast::VoidType * node ) {
    16061625        VISIT_START( node );
    16071626
     
    16111630//--------------------------------------------------------------------------
    16121631// BasicType
    1613 template< typename pass_t >
    1614 const ast::Type * ast::Pass< pass_t >::visit( const ast::BasicType * node ) {
     1632template< typename core_t >
     1633const ast::Type * ast::Pass< core_t >::visit( const ast::BasicType * node ) {
    16151634        VISIT_START( node );
    16161635
     
    16201639//--------------------------------------------------------------------------
    16211640// PointerType
    1622 template< typename pass_t >
    1623 const ast::Type * ast::Pass< pass_t >::visit( const ast::PointerType * node ) {
     1641template< typename core_t >
     1642const ast::Type * ast::Pass< core_t >::visit( const ast::PointerType * node ) {
    16241643        VISIT_START( node );
    16251644
     
    16341653//--------------------------------------------------------------------------
    16351654// ArrayType
    1636 template< typename pass_t >
    1637 const ast::Type * ast::Pass< pass_t >::visit( const ast::ArrayType * node ) {
     1655template< typename core_t >
     1656const ast::Type * ast::Pass< core_t >::visit( const ast::ArrayType * node ) {
    16381657        VISIT_START( node );
    16391658
     
    16481667//--------------------------------------------------------------------------
    16491668// ReferenceType
    1650 template< typename pass_t >
    1651 const ast::Type * ast::Pass< pass_t >::visit( const ast::ReferenceType * node ) {
     1669template< typename core_t >
     1670const ast::Type * ast::Pass< core_t >::visit( const ast::ReferenceType * node ) {
    16521671        VISIT_START( node );
    16531672
     
    16611680//--------------------------------------------------------------------------
    16621681// QualifiedType
    1663 template< typename pass_t >
    1664 const ast::Type * ast::Pass< pass_t >::visit( const ast::QualifiedType * node ) {
     1682template< typename core_t >
     1683const ast::Type * ast::Pass< core_t >::visit( const ast::QualifiedType * node ) {
    16651684        VISIT_START( node );
    16661685
     
    16751694//--------------------------------------------------------------------------
    16761695// FunctionType
    1677 template< typename pass_t >
    1678 const ast::Type * ast::Pass< pass_t >::visit( const ast::FunctionType * node ) {
    1679         VISIT_START( node );
    1680 
    1681         VISIT(
    1682                 maybe_accept( node, &FunctionType::forall  );
     1696template< typename core_t >
     1697const ast::Type * ast::Pass< core_t >::visit( const ast::FunctionType * node ) {
     1698        VISIT_START( node );
     1699
     1700        VISIT({
     1701                guard_forall_subs forall_guard { *this, node };
     1702                mutate_forall( node );
    16831703                maybe_accept( node, &FunctionType::returns );
    16841704                maybe_accept( node, &FunctionType::params  );
    1685         )
     1705        })
    16861706
    16871707        VISIT_END( Type, node );
     
    16901710//--------------------------------------------------------------------------
    16911711// StructInstType
    1692 template< typename pass_t >
    1693 const ast::Type * ast::Pass< pass_t >::visit( const ast::StructInstType * node ) {
    1694         VISIT_START( node );
    1695 
    1696         __pass::symtab::addStruct( pass, 0, node->name );
     1712template< typename core_t >
     1713const ast::Type * ast::Pass< core_t >::visit( const ast::StructInstType * node ) {
     1714        VISIT_START( node );
     1715
     1716        __pass::symtab::addStruct( core, 0, node->name );
    16971717
    16981718        VISIT({
    16991719                guard_symtab guard { *this };
    1700                 maybe_accept( node, &StructInstType::forall );
     1720                guard_forall_subs forall_guard { *this, node };
     1721                mutate_forall( node );
    17011722                maybe_accept( node, &StructInstType::params );
    17021723        })
     
    17071728//--------------------------------------------------------------------------
    17081729// UnionInstType
    1709 template< typename pass_t >
    1710 const ast::Type * ast::Pass< pass_t >::visit( const ast::UnionInstType * node ) {
    1711         VISIT_START( node );
    1712 
    1713         __pass::symtab::addStruct( pass, 0, node->name );
    1714 
    1715         {
     1730template< typename core_t >
     1731const ast::Type * ast::Pass< core_t >::visit( const ast::UnionInstType * node ) {
     1732        VISIT_START( node );
     1733
     1734        __pass::symtab::addUnion( core, 0, node->name );
     1735
     1736        VISIT({
    17161737                guard_symtab guard { *this };
    1717                 maybe_accept( node, &UnionInstType::forall );
     1738                guard_forall_subs forall_guard { *this, node };
     1739                mutate_forall( node );
    17181740                maybe_accept( node, &UnionInstType::params );
    1719         }
     1741        })
    17201742
    17211743        VISIT_END( Type, node );
     
    17241746//--------------------------------------------------------------------------
    17251747// EnumInstType
    1726 template< typename pass_t >
    1727 const ast::Type * ast::Pass< pass_t >::visit( const ast::EnumInstType * node ) {
    1728         VISIT_START( node );
    1729 
    1730         VISIT(
    1731                 maybe_accept( node, &EnumInstType::forall );
     1748template< typename core_t >
     1749const ast::Type * ast::Pass< core_t >::visit( const ast::EnumInstType * node ) {
     1750        VISIT_START( node );
     1751
     1752        VISIT({
     1753                guard_forall_subs forall_guard { *this, node };
     1754                mutate_forall( node );
    17321755                maybe_accept( node, &EnumInstType::params );
    1733         )
     1756        })
    17341757
    17351758        VISIT_END( Type, node );
     
    17381761//--------------------------------------------------------------------------
    17391762// TraitInstType
    1740 template< typename pass_t >
    1741 const ast::Type * ast::Pass< pass_t >::visit( const ast::TraitInstType * node ) {
    1742         VISIT_START( node );
    1743 
    1744         VISIT(
    1745                 maybe_accept( node, &TraitInstType::forall );
     1763template< typename core_t >
     1764const ast::Type * ast::Pass< core_t >::visit( const ast::TraitInstType * node ) {
     1765        VISIT_START( node );
     1766
     1767        VISIT({
     1768                guard_forall_subs forall_guard { *this, node };
     1769                mutate_forall( node );
    17461770                maybe_accept( node, &TraitInstType::params );
    1747         )
     1771        })
    17481772
    17491773        VISIT_END( Type, node );
     
    17521776//--------------------------------------------------------------------------
    17531777// TypeInstType
    1754 template< typename pass_t >
    1755 const ast::Type * ast::Pass< pass_t >::visit( const ast::TypeInstType * node ) {
    1756         VISIT_START( node );
    1757 
    1758         VISIT(
    1759                 maybe_accept( node, &TypeInstType::forall );
    1760                 maybe_accept( node, &TypeInstType::params );
     1778template< typename core_t >
     1779const ast::Type * ast::Pass< core_t >::visit( const ast::TypeInstType * node ) {
     1780        VISIT_START( node );
     1781
     1782        VISIT(
     1783                {
     1784                        guard_forall_subs forall_guard { *this, node };
     1785                        mutate_forall( node );
     1786                        maybe_accept( node, &TypeInstType::params );
     1787                }
     1788                // ensure that base re-bound if doing substitution
     1789                __pass::forall::replace( core, 0, node );
    17611790        )
    17621791
     
    17661795//--------------------------------------------------------------------------
    17671796// TupleType
    1768 template< typename pass_t >
    1769 const ast::Type * ast::Pass< pass_t >::visit( const ast::TupleType * node ) {
     1797template< typename core_t >
     1798const ast::Type * ast::Pass< core_t >::visit( const ast::TupleType * node ) {
    17701799        VISIT_START( node );
    17711800
     
    17801809//--------------------------------------------------------------------------
    17811810// TypeofType
    1782 template< typename pass_t >
    1783 const ast::Type * ast::Pass< pass_t >::visit( const ast::TypeofType * node ) {
     1811template< typename core_t >
     1812const ast::Type * ast::Pass< core_t >::visit( const ast::TypeofType * node ) {
    17841813        VISIT_START( node );
    17851814
     
    17931822//--------------------------------------------------------------------------
    17941823// VarArgsType
    1795 template< typename pass_t >
    1796 const ast::Type * ast::Pass< pass_t >::visit( const ast::VarArgsType * node ) {
     1824template< typename core_t >
     1825const ast::Type * ast::Pass< core_t >::visit( const ast::VarArgsType * node ) {
    17971826        VISIT_START( node );
    17981827
     
    18021831//--------------------------------------------------------------------------
    18031832// ZeroType
    1804 template< typename pass_t >
    1805 const ast::Type * ast::Pass< pass_t >::visit( const ast::ZeroType * node ) {
     1833template< typename core_t >
     1834const ast::Type * ast::Pass< core_t >::visit( const ast::ZeroType * node ) {
    18061835        VISIT_START( node );
    18071836
     
    18111840//--------------------------------------------------------------------------
    18121841// OneType
    1813 template< typename pass_t >
    1814 const ast::Type * ast::Pass< pass_t >::visit( const ast::OneType * node ) {
     1842template< typename core_t >
     1843const ast::Type * ast::Pass< core_t >::visit( const ast::OneType * node ) {
    18151844        VISIT_START( node );
    18161845
     
    18201849//--------------------------------------------------------------------------
    18211850// GlobalScopeType
    1822 template< typename pass_t >
    1823 const ast::Type * ast::Pass< pass_t >::visit( const ast::GlobalScopeType * node ) {
     1851template< typename core_t >
     1852const ast::Type * ast::Pass< core_t >::visit( const ast::GlobalScopeType * node ) {
    18241853        VISIT_START( node );
    18251854
     
    18301859//--------------------------------------------------------------------------
    18311860// Designation
    1832 template< typename pass_t >
    1833 const ast::Designation * ast::Pass< pass_t >::visit( const ast::Designation * node ) {
     1861template< typename core_t >
     1862const ast::Designation * ast::Pass< core_t >::visit( const ast::Designation * node ) {
    18341863        VISIT_START( node );
    18351864
     
    18411870//--------------------------------------------------------------------------
    18421871// SingleInit
    1843 template< typename pass_t >
    1844 const ast::Init * ast::Pass< pass_t >::visit( const ast::SingleInit * node ) {
     1872template< typename core_t >
     1873const ast::Init * ast::Pass< core_t >::visit( const ast::SingleInit * node ) {
    18451874        VISIT_START( node );
    18461875
     
    18541883//--------------------------------------------------------------------------
    18551884// ListInit
    1856 template< typename pass_t >
    1857 const ast::Init * ast::Pass< pass_t >::visit( const ast::ListInit * node ) {
     1885template< typename core_t >
     1886const ast::Init * ast::Pass< core_t >::visit( const ast::ListInit * node ) {
    18581887        VISIT_START( node );
    18591888
     
    18681897//--------------------------------------------------------------------------
    18691898// ConstructorInit
    1870 template< typename pass_t >
    1871 const ast::Init * ast::Pass< pass_t >::visit( const ast::ConstructorInit * node ) {
     1899template< typename core_t >
     1900const ast::Init * ast::Pass< core_t >::visit( const ast::ConstructorInit * node ) {
    18721901        VISIT_START( node );
    18731902
     
    18831912//--------------------------------------------------------------------------
    18841913// Attribute
    1885 template< typename pass_t >
    1886 const ast::Attribute * ast::Pass< pass_t >::visit( const ast::Attribute * node  )  {
     1914template< typename core_t >
     1915const ast::Attribute * ast::Pass< core_t >::visit( const ast::Attribute * node  )  {
    18871916        VISIT_START( node );
    18881917
     
    18961925//--------------------------------------------------------------------------
    18971926// TypeSubstitution
    1898 template< typename pass_t >
    1899 const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) {
     1927template< typename core_t >
     1928const ast::TypeSubstitution * ast::Pass< core_t >::visit( const ast::TypeSubstitution * node ) {
    19001929        VISIT_START( node );
    19011930
     
    19071936                                guard_symtab guard { *this };
    19081937                                auto new_node = p.second->accept( *this );
    1909                                 if (new_node != p.second) mutated = false;
     1938                                if (new_node != p.second) mutated = true;
    19101939                                new_map.insert({ p.first, new_node });
    19111940                        }
     
    19231952                                guard_symtab guard { *this };
    19241953                                auto new_node = p.second->accept( *this );
    1925                                 if (new_node != p.second) mutated = false;
     1954                                if (new_node != p.second) mutated = true;
    19261955                                new_map.insert({ p.first, new_node });
    19271956                        }
Note: See TracChangeset for help on using the changeset viewer.