Changes in src/AST/Pass.impl.hpp [7ff3e522:37cdd97]
- File:
-
- 1 edited
-
src/AST/Pass.impl.hpp (modified) (116 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.impl.hpp
r7ff3e522 r37cdd97 25 25 using namespace ast; \ 26 26 /* back-up the visit children */ \ 27 __attribute__((unused)) ast::__pass::visit_children_guard guard1( ast::__pass::visit_children( core, 0) ); \27 __attribute__((unused)) ast::__pass::visit_children_guard guard1( ast::__pass::visit_children(pass, 0) ); \ 28 28 /* setup the scope for passes that want to run code at exit */ \ 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 ); \ 29 __attribute__((unused)) ast::__pass::guard_value guard2( ast::__pass::at_cleanup (pass, 0) ); \ 32 30 /* call the implementation of the previsit of this pass */ \ 33 __pass::previsit( core, node, 0 );31 __pass::previsit( pass, node, 0 ); 34 32 35 33 #define VISIT( code... ) \ … … 42 40 #define VISIT_END( type, node ) \ 43 41 /* call the implementation of the postvisit of this pass */ \ 44 auto __return = __pass::postvisit( core, node, 0 ); \42 auto __return = __pass::postvisit( pass, node, 0 ); \ 45 43 assertf(__return, "post visit should never return null"); \ 46 /* end tracing memory allocation if requested by this pass */ \47 __pass::endTrace( core, 0 ); \48 44 return __return; 49 45 … … 123 119 } 124 120 125 template< typename core_t >121 template< typename pass_t > 126 122 template< typename node_t > 127 auto ast::Pass< core_t >::call_accept( const node_t * node )123 auto ast::Pass< pass_t >::call_accept( const node_t * node ) 128 124 -> typename std::enable_if< 129 125 !std::is_base_of<ast::Expr, node_t>::value && … … 131 127 , decltype( node->accept(*this) ) 132 128 >::type 129 133 130 { 134 131 __pedantic_pass_assert( __visit_children() ); 135 __pedantic_pass_assert( node);132 __pedantic_pass_assert( expr ); 136 133 137 134 static_assert( !std::is_base_of<ast::Expr, node_t>::value, "ERROR"); … … 141 138 } 142 139 143 template< typename core_t >144 const ast::Expr * ast::Pass< core_t >::call_accept( const ast::Expr * expr ) {140 template< typename pass_t > 141 const ast::Expr * ast::Pass< pass_t >::call_accept( const ast::Expr * expr ) { 145 142 __pedantic_pass_assert( __visit_children() ); 146 143 __pedantic_pass_assert( expr ); 147 144 148 const ast::TypeSubstitution ** env_ptr = __pass::env( core, 0);145 const ast::TypeSubstitution ** env_ptr = __pass::env( pass, 0); 149 146 if ( env_ptr && expr->env ) { 150 147 *env_ptr = expr->env; … … 154 151 } 155 152 156 template< typename core_t >157 const ast::Stmt * ast::Pass< core_t >::call_accept( const ast::Stmt * stmt ) {153 template< typename pass_t > 154 const ast::Stmt * ast::Pass< pass_t >::call_accept( const ast::Stmt * stmt ) { 158 155 __pedantic_pass_assert( __visit_children() ); 159 156 __pedantic_pass_assert( stmt ); … … 163 160 164 161 // get the stmts/decls that will need to be spliced in 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);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); 169 166 170 167 // These may be modified by subnode but most be restored once we exit this statemnet. 171 ValueGuardPtr< const ast::TypeSubstitution * > __old_env ( __pass::env( core, 0) );168 ValueGuardPtr< const ast::TypeSubstitution * > __old_env ( __pass::env( pass, 0) ); 172 169 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before ); 173 170 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after ); … … 205 202 } 206 203 207 template< typename core_t >204 template< typename pass_t > 208 205 template< template <class...> class container_t > 209 container_t< ptr<Stmt> > ast::Pass< core_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {206 container_t< ptr<Stmt> > ast::Pass< pass_t >::call_accept( const container_t< ptr<Stmt> > & statements ) { 210 207 __pedantic_pass_assert( __visit_children() ); 211 208 if( statements.empty() ) return {}; … … 218 215 219 216 // get the stmts/decls that will need to be spliced in 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);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); 224 221 225 222 // These may be modified by subnode but most be restored once we exit this statemnet. … … 271 268 } 272 269 273 template< typename core_t >270 template< typename pass_t > 274 271 template< template <class...> class container_t, typename node_t > 275 container_t< ast::ptr<node_t> > ast::Pass< core_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {272 container_t< ast::ptr<node_t> > ast::Pass< pass_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) { 276 273 __pedantic_pass_assert( __visit_children() ); 277 274 if( container.empty() ) return {}; … … 302 299 } 303 300 304 template< typename core_t >301 template< typename pass_t > 305 302 template<typename node_t, typename parent_t, typename child_t> 306 void ast::Pass< core_t >::maybe_accept(303 void ast::Pass< pass_t >::maybe_accept( 307 304 const node_t * & parent, 308 305 child_t parent_t::*child … … 326 323 } 327 324 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 clone334 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 mutate341 maybe_accept( node, &node_t::forall );342 }343 }344 325 } 345 326 … … 352 333 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 353 334 354 template< typename core_t >355 inline void ast::accept_all( std::list< ast::ptr<ast::Decl> > & decls, ast::Pass< core_t > & visitor ) {335 template< typename pass_t > 336 inline void ast::accept_all( std::list< ast::ptr<ast::Decl> > & decls, ast::Pass< pass_t > & visitor ) { 356 337 // We are going to aggregate errors for all these statements 357 338 SemanticErrorException errors; … … 361 342 362 343 // get the stmts/decls that will need to be spliced in 363 auto decls_before = __pass::declsToAddBefore( visitor. core, 0);364 auto decls_after = __pass::declsToAddAfter ( visitor. core, 0);344 auto decls_before = __pass::declsToAddBefore( visitor.pass, 0); 345 auto decls_after = __pass::declsToAddAfter ( visitor.pass, 0); 365 346 366 347 // update pass statitistics … … 411 392 //-------------------------------------------------------------------------- 412 393 // ObjectDecl 413 template< typename core_t >414 const ast::DeclWithType * ast::Pass< core_t >::visit( const ast::ObjectDecl * node ) {394 template< typename pass_t > 395 const ast::DeclWithType * ast::Pass< pass_t >::visit( const ast::ObjectDecl * node ) { 415 396 VISIT_START( node ); 416 397 … … 425 406 ) 426 407 427 __pass::symtab::addId( core, 0, node );408 __pass::symtab::addId( pass, 0, node ); 428 409 429 410 VISIT_END( DeclWithType, node ); … … 432 413 //-------------------------------------------------------------------------- 433 414 // FunctionDecl 434 template< typename core_t >435 const ast::DeclWithType * ast::Pass< core_t >::visit( const ast::FunctionDecl * node ) {436 VISIT_START( node ); 437 438 __pass::symtab::addId( core, 0, node );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 ); 439 420 440 421 VISIT(maybe_accept( node, &FunctionDecl::withExprs );) … … 444 425 // shadow with exprs and not the other way around. 445 426 guard_symtab guard { *this }; 446 __pass::symtab::addWith( core, 0, node->withExprs, node );427 __pass::symtab::addWith( pass, 0, node->withExprs, node ); 447 428 { 448 429 guard_symtab guard { *this }; 449 430 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 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 },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 ) ), 454 435 nullptr, VariableLen, DynamicDim 455 }456 } };457 __pass::symtab::addId( core, 0,func );436 ) 437 ); 438 __pass::symtab::addId( pass, 0, &func ); 458 439 VISIT( 459 440 maybe_accept( node, &FunctionDecl::type ); … … 473 454 //-------------------------------------------------------------------------- 474 455 // StructDecl 475 template< typename core_t >476 const ast::Decl * ast::Pass< core_t >::visit( const ast::StructDecl * node ) {456 template< typename pass_t > 457 const ast::Decl * ast::Pass< pass_t >::visit( const ast::StructDecl * node ) { 477 458 VISIT_START( node ); 478 459 479 460 // make up a forward declaration and add it before processing the members 480 461 // needs to be on the heap because addStruct saves the pointer 481 __pass::symtab::addStructFwd( core, 0, node );462 __pass::symtab::addStructFwd( pass, 0, node ); 482 463 483 464 VISIT({ … … 488 469 489 470 // this addition replaces the forward declaration 490 __pass::symtab::addStruct( core, 0, node );471 __pass::symtab::addStruct( pass, 0, node ); 491 472 492 473 VISIT_END( Decl, node ); … … 495 476 //-------------------------------------------------------------------------- 496 477 // UnionDecl 497 template< typename core_t >498 const ast::Decl * ast::Pass< core_t >::visit( const ast::UnionDecl * node ) {478 template< typename pass_t > 479 const ast::Decl * ast::Pass< pass_t >::visit( const ast::UnionDecl * node ) { 499 480 VISIT_START( node ); 500 481 501 482 // make up a forward declaration and add it before processing the members 502 __pass::symtab::addUnionFwd( core, 0, node );483 __pass::symtab::addUnionFwd( pass, 0, node ); 503 484 504 485 VISIT({ … … 508 489 }) 509 490 510 __pass::symtab::addUnion( core, 0, node );491 __pass::symtab::addUnion( pass, 0, node ); 511 492 512 493 VISIT_END( Decl, node ); … … 515 496 //-------------------------------------------------------------------------- 516 497 // EnumDecl 517 template< typename core_t >518 const ast::Decl * ast::Pass< core_t >::visit( const ast::EnumDecl * node ) {519 VISIT_START( node ); 520 521 __pass::symtab::addEnum( core, 0, node );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 ); 522 503 523 504 VISIT( … … 532 513 //-------------------------------------------------------------------------- 533 514 // TraitDecl 534 template< typename core_t >535 const ast::Decl * ast::Pass< core_t >::visit( const ast::TraitDecl * node ) {515 template< typename pass_t > 516 const ast::Decl * ast::Pass< pass_t >::visit( const ast::TraitDecl * node ) { 536 517 VISIT_START( node ); 537 518 … … 542 523 }) 543 524 544 __pass::symtab::addTrait( core, 0, node );525 __pass::symtab::addTrait( pass, 0, node ); 545 526 546 527 VISIT_END( Decl, node ); … … 549 530 //-------------------------------------------------------------------------- 550 531 // TypeDecl 551 template< typename core_t >552 const ast::Decl * ast::Pass< core_t >::visit( const ast::TypeDecl * node ) {532 template< typename pass_t > 533 const ast::Decl * ast::Pass< pass_t >::visit( const ast::TypeDecl * node ) { 553 534 VISIT_START( node ); 554 535 … … 562 543 // note that assertions come after the type is added to the symtab, since they are not part of the type proper 563 544 // and may depend on the type itself 564 __pass::symtab::addType( core, 0, node );545 __pass::symtab::addType( pass, 0, node ); 565 546 566 547 VISIT( … … 578 559 //-------------------------------------------------------------------------- 579 560 // TypedefDecl 580 template< typename core_t >581 const ast::Decl * ast::Pass< core_t >::visit( const ast::TypedefDecl * node ) {561 template< typename pass_t > 562 const ast::Decl * ast::Pass< pass_t >::visit( const ast::TypedefDecl * node ) { 582 563 VISIT_START( node ); 583 564 … … 588 569 }) 589 570 590 __pass::symtab::addType( core, 0, node );571 __pass::symtab::addType( pass, 0, node ); 591 572 592 573 VISIT( maybe_accept( node, &TypedefDecl::assertions ); ) … … 597 578 //-------------------------------------------------------------------------- 598 579 // AsmDecl 599 template< typename core_t >600 const ast::AsmDecl * ast::Pass< core_t >::visit( const ast::AsmDecl * node ) {580 template< typename pass_t > 581 const ast::AsmDecl * ast::Pass< pass_t >::visit( const ast::AsmDecl * node ) { 601 582 VISIT_START( node ); 602 583 … … 610 591 //-------------------------------------------------------------------------- 611 592 // StaticAssertDecl 612 template< typename core_t >613 const ast::StaticAssertDecl * ast::Pass< core_t >::visit( const ast::StaticAssertDecl * node ) {593 template< typename pass_t > 594 const ast::StaticAssertDecl * ast::Pass< pass_t >::visit( const ast::StaticAssertDecl * node ) { 614 595 VISIT_START( node ); 615 596 … … 624 605 //-------------------------------------------------------------------------- 625 606 // CompoundStmt 626 template< typename core_t >627 const ast::CompoundStmt * ast::Pass< core_t >::visit( const ast::CompoundStmt * node ) {607 template< typename pass_t > 608 const ast::CompoundStmt * ast::Pass< pass_t >::visit( const ast::CompoundStmt * node ) { 628 609 VISIT_START( node ); 629 610 VISIT({ 630 611 // do not enter a new scope if inFunction is true - needs to check old state before the assignment 631 auto guard1 = makeFuncGuard( [this, inFunction Cpy= this->inFunction]() {632 if ( ! inFunction Cpy ) __pass::symtab::enter(core, 0);633 }, [this, inFunction Cpy= this->inFunction]() {634 if ( ! inFunction Cpy ) __pass::symtab::leave(core, 0);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); 635 616 }); 636 617 ValueGuard< bool > guard2( inFunction ); … … 644 625 //-------------------------------------------------------------------------- 645 626 // ExprStmt 646 template< typename core_t >647 const ast::Stmt * ast::Pass< core_t >::visit( const ast::ExprStmt * node ) {627 template< typename pass_t > 628 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ExprStmt * node ) { 648 629 VISIT_START( node ); 649 630 … … 657 638 //-------------------------------------------------------------------------- 658 639 // AsmStmt 659 template< typename core_t >660 const ast::Stmt * ast::Pass< core_t >::visit( const ast::AsmStmt * node ) {640 template< typename pass_t > 641 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::AsmStmt * node ) { 661 642 VISIT_START( node ) 662 643 … … 673 654 //-------------------------------------------------------------------------- 674 655 // DirectiveStmt 675 template< typename core_t >676 const ast::Stmt * ast::Pass< core_t >::visit( const ast::DirectiveStmt * node ) {656 template< typename pass_t > 657 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::DirectiveStmt * node ) { 677 658 VISIT_START( node ) 678 659 … … 682 663 //-------------------------------------------------------------------------- 683 664 // IfStmt 684 template< typename core_t >685 const ast::Stmt * ast::Pass< core_t >::visit( const ast::IfStmt * node ) {665 template< typename pass_t > 666 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::IfStmt * node ) { 686 667 VISIT_START( node ); 687 668 … … 700 681 //-------------------------------------------------------------------------- 701 682 // WhileStmt 702 template< typename core_t >703 const ast::Stmt * ast::Pass< core_t >::visit( const ast::WhileStmt * node ) {683 template< typename pass_t > 684 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::WhileStmt * node ) { 704 685 VISIT_START( node ); 705 686 … … 717 698 //-------------------------------------------------------------------------- 718 699 // ForStmt 719 template< typename core_t >720 const ast::Stmt * ast::Pass< core_t >::visit( const ast::ForStmt * node ) {700 template< typename pass_t > 701 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ForStmt * node ) { 721 702 VISIT_START( node ); 722 703 … … 735 716 //-------------------------------------------------------------------------- 736 717 // SwitchStmt 737 template< typename core_t >738 const ast::Stmt * ast::Pass< core_t >::visit( const ast::SwitchStmt * node ) {718 template< typename pass_t > 719 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::SwitchStmt * node ) { 739 720 VISIT_START( node ); 740 721 … … 749 730 //-------------------------------------------------------------------------- 750 731 // CaseStmt 751 template< typename core_t >752 const ast::Stmt * ast::Pass< core_t >::visit( const ast::CaseStmt * node ) {732 template< typename pass_t > 733 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::CaseStmt * node ) { 753 734 VISIT_START( node ); 754 735 … … 763 744 //-------------------------------------------------------------------------- 764 745 // BranchStmt 765 template< typename core_t >766 const ast::Stmt * ast::Pass< core_t >::visit( const ast::BranchStmt * node ) {746 template< typename pass_t > 747 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::BranchStmt * node ) { 767 748 VISIT_START( node ); 768 749 VISIT_END( Stmt, node ); … … 771 752 //-------------------------------------------------------------------------- 772 753 // ReturnStmt 773 template< typename core_t >774 const ast::Stmt * ast::Pass< core_t >::visit( const ast::ReturnStmt * node ) {754 template< typename pass_t > 755 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ReturnStmt * node ) { 775 756 VISIT_START( node ); 776 757 … … 784 765 //-------------------------------------------------------------------------- 785 766 // ThrowStmt 786 template< typename core_t >787 const ast::Stmt * ast::Pass< core_t >::visit( const ast::ThrowStmt * node ) {767 template< typename pass_t > 768 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ThrowStmt * node ) { 788 769 VISIT_START( node ); 789 770 … … 798 779 //-------------------------------------------------------------------------- 799 780 // TryStmt 800 template< typename core_t >801 const ast::Stmt * ast::Pass< core_t >::visit( const ast::TryStmt * node ) {781 template< typename pass_t > 782 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::TryStmt * node ) { 802 783 VISIT_START( node ); 803 784 … … 813 794 //-------------------------------------------------------------------------- 814 795 // CatchStmt 815 template< typename core_t >816 const ast::Stmt * ast::Pass< core_t >::visit( const ast::CatchStmt * node ) {796 template< typename pass_t > 797 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::CatchStmt * node ) { 817 798 VISIT_START( node ); 818 799 … … 830 811 //-------------------------------------------------------------------------- 831 812 // FinallyStmt 832 template< typename core_t >833 const ast::Stmt * ast::Pass< core_t >::visit( const ast::FinallyStmt * node ) {813 template< typename pass_t > 814 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::FinallyStmt * node ) { 834 815 VISIT_START( node ); 835 816 … … 843 824 //-------------------------------------------------------------------------- 844 825 // FinallyStmt 845 template< typename core_t >846 const ast::Stmt * ast::Pass< core_t >::visit( const ast::SuspendStmt * node ) {826 template< typename pass_t > 827 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::SuspendStmt * node ) { 847 828 VISIT_START( node ); 848 829 … … 856 837 //-------------------------------------------------------------------------- 857 838 // WaitForStmt 858 template< typename core_t >859 const ast::Stmt * ast::Pass< core_t >::visit( const ast::WaitForStmt * node ) {839 template< typename pass_t > 840 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::WaitForStmt * node ) { 860 841 VISIT_START( node ); 861 842 // for( auto & clause : node->clauses ) { … … 925 906 //-------------------------------------------------------------------------- 926 907 // WithStmt 927 template< typename core_t >928 const ast::Decl * ast::Pass< core_t >::visit( const ast::WithStmt * node ) {908 template< typename pass_t > 909 const ast::Decl * ast::Pass< pass_t >::visit( const ast::WithStmt * node ) { 929 910 VISIT_START( node ); 930 911 … … 934 915 // catch statements introduce a level of scope (for the caught exception) 935 916 guard_symtab guard { *this }; 936 __pass::symtab::addWith( core, 0, node->exprs, node );917 __pass::symtab::addWith( pass, 0, node->exprs, node ); 937 918 maybe_accept( node, &WithStmt::stmt ); 938 919 } … … 943 924 //-------------------------------------------------------------------------- 944 925 // NullStmt 945 template< typename core_t >946 const ast::NullStmt * ast::Pass< core_t >::visit( const ast::NullStmt * node ) {926 template< typename pass_t > 927 const ast::NullStmt * ast::Pass< pass_t >::visit( const ast::NullStmt * node ) { 947 928 VISIT_START( node ); 948 929 VISIT_END( NullStmt, node ); … … 951 932 //-------------------------------------------------------------------------- 952 933 // DeclStmt 953 template< typename core_t >954 const ast::Stmt * ast::Pass< core_t >::visit( const ast::DeclStmt * node ) {934 template< typename pass_t > 935 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::DeclStmt * node ) { 955 936 VISIT_START( node ); 956 937 … … 964 945 //-------------------------------------------------------------------------- 965 946 // ImplicitCtorDtorStmt 966 template< typename core_t >967 const ast::Stmt * ast::Pass< core_t >::visit( const ast::ImplicitCtorDtorStmt * node ) {947 template< typename pass_t > 948 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ImplicitCtorDtorStmt * node ) { 968 949 VISIT_START( node ); 969 950 970 951 // For now this isn't visited, it is unclear if this causes problem 971 952 // if all tests are known to pass, remove this code 972 VISIT(973 maybe_accept( node, &ImplicitCtorDtorStmt::callStmt );974 )953 // VISIT( 954 // maybe_accept( node, &ImplicitCtorDtorStmt::callStmt ); 955 // ) 975 956 976 957 VISIT_END( Stmt, node ); … … 979 960 //-------------------------------------------------------------------------- 980 961 // ApplicationExpr 981 template< typename core_t >982 const ast::Expr * ast::Pass< core_t >::visit( const ast::ApplicationExpr * node ) {962 template< typename pass_t > 963 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ApplicationExpr * node ) { 983 964 VISIT_START( node ); 984 965 … … 997 978 //-------------------------------------------------------------------------- 998 979 // UntypedExpr 999 template< typename core_t >1000 const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedExpr * node ) {980 template< typename pass_t > 981 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedExpr * node ) { 1001 982 VISIT_START( node ); 1002 983 … … 1015 996 //-------------------------------------------------------------------------- 1016 997 // NameExpr 1017 template< typename core_t >1018 const ast::Expr * ast::Pass< core_t >::visit( const ast::NameExpr * node ) {998 template< typename pass_t > 999 const ast::Expr * ast::Pass< pass_t >::visit( const ast::NameExpr * node ) { 1019 1000 VISIT_START( node ); 1020 1001 … … 1029 1010 //-------------------------------------------------------------------------- 1030 1011 // CastExpr 1031 template< typename core_t >1032 const ast::Expr * ast::Pass< core_t >::visit( const ast::CastExpr * node ) {1012 template< typename pass_t > 1013 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CastExpr * node ) { 1033 1014 VISIT_START( node ); 1034 1015 … … 1045 1026 //-------------------------------------------------------------------------- 1046 1027 // KeywordCastExpr 1047 template< typename core_t >1048 const ast::Expr * ast::Pass< core_t >::visit( const ast::KeywordCastExpr * node ) {1028 template< typename pass_t > 1029 const ast::Expr * ast::Pass< pass_t >::visit( const ast::KeywordCastExpr * node ) { 1049 1030 VISIT_START( node ); 1050 1031 … … 1061 1042 //-------------------------------------------------------------------------- 1062 1043 // VirtualCastExpr 1063 template< typename core_t >1064 const ast::Expr * ast::Pass< core_t >::visit( const ast::VirtualCastExpr * node ) {1044 template< typename pass_t > 1045 const ast::Expr * ast::Pass< pass_t >::visit( const ast::VirtualCastExpr * node ) { 1065 1046 VISIT_START( node ); 1066 1047 … … 1077 1058 //-------------------------------------------------------------------------- 1078 1059 // AddressExpr 1079 template< typename core_t >1080 const ast::Expr * ast::Pass< core_t >::visit( const ast::AddressExpr * node ) {1060 template< typename pass_t > 1061 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AddressExpr * node ) { 1081 1062 VISIT_START( node ); 1082 1063 … … 1093 1074 //-------------------------------------------------------------------------- 1094 1075 // LabelAddressExpr 1095 template< typename core_t >1096 const ast::Expr * ast::Pass< core_t >::visit( const ast::LabelAddressExpr * node ) {1076 template< typename pass_t > 1077 const ast::Expr * ast::Pass< pass_t >::visit( const ast::LabelAddressExpr * node ) { 1097 1078 VISIT_START( node ); 1098 1079 … … 1107 1088 //-------------------------------------------------------------------------- 1108 1089 // UntypedMemberExpr 1109 template< typename core_t >1110 const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedMemberExpr * node ) {1090 template< typename pass_t > 1091 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedMemberExpr * node ) { 1111 1092 VISIT_START( node ); 1112 1093 … … 1124 1105 //-------------------------------------------------------------------------- 1125 1106 // MemberExpr 1126 template< typename core_t >1127 const ast::Expr * ast::Pass< core_t >::visit( const ast::MemberExpr * node ) {1107 template< typename pass_t > 1108 const ast::Expr * ast::Pass< pass_t >::visit( const ast::MemberExpr * node ) { 1128 1109 VISIT_START( node ); 1129 1110 … … 1140 1121 //-------------------------------------------------------------------------- 1141 1122 // VariableExpr 1142 template< typename core_t >1143 const ast::Expr * ast::Pass< core_t >::visit( const ast::VariableExpr * node ) {1123 template< typename pass_t > 1124 const ast::Expr * ast::Pass< pass_t >::visit( const ast::VariableExpr * node ) { 1144 1125 VISIT_START( node ); 1145 1126 … … 1154 1135 //-------------------------------------------------------------------------- 1155 1136 // ConstantExpr 1156 template< typename core_t >1157 const ast::Expr * ast::Pass< core_t >::visit( const ast::ConstantExpr * node ) {1137 template< typename pass_t > 1138 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstantExpr * node ) { 1158 1139 VISIT_START( node ); 1159 1140 … … 1168 1149 //-------------------------------------------------------------------------- 1169 1150 // SizeofExpr 1170 template< typename core_t >1171 const ast::Expr * ast::Pass< core_t >::visit( const ast::SizeofExpr * node ) {1151 template< typename pass_t > 1152 const ast::Expr * ast::Pass< pass_t >::visit( const ast::SizeofExpr * node ) { 1172 1153 VISIT_START( node ); 1173 1154 … … 1188 1169 //-------------------------------------------------------------------------- 1189 1170 // AlignofExpr 1190 template< typename core_t >1191 const ast::Expr * ast::Pass< core_t >::visit( const ast::AlignofExpr * node ) {1171 template< typename pass_t > 1172 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AlignofExpr * node ) { 1192 1173 VISIT_START( node ); 1193 1174 … … 1208 1189 //-------------------------------------------------------------------------- 1209 1190 // UntypedOffsetofExpr 1210 template< typename core_t >1211 const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedOffsetofExpr * node ) {1191 template< typename pass_t > 1192 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedOffsetofExpr * node ) { 1212 1193 VISIT_START( node ); 1213 1194 … … 1224 1205 //-------------------------------------------------------------------------- 1225 1206 // OffsetofExpr 1226 template< typename core_t >1227 const ast::Expr * ast::Pass< core_t >::visit( const ast::OffsetofExpr * node ) {1207 template< typename pass_t > 1208 const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetofExpr * node ) { 1228 1209 VISIT_START( node ); 1229 1210 … … 1240 1221 //-------------------------------------------------------------------------- 1241 1222 // OffsetPackExpr 1242 template< typename core_t >1243 const ast::Expr * ast::Pass< core_t >::visit( const ast::OffsetPackExpr * node ) {1223 template< typename pass_t > 1224 const ast::Expr * ast::Pass< pass_t >::visit( const ast::OffsetPackExpr * node ) { 1244 1225 VISIT_START( node ); 1245 1226 … … 1256 1237 //-------------------------------------------------------------------------- 1257 1238 // LogicalExpr 1258 template< typename core_t >1259 const ast::Expr * ast::Pass< core_t >::visit( const ast::LogicalExpr * node ) {1239 template< typename pass_t > 1240 const ast::Expr * ast::Pass< pass_t >::visit( const ast::LogicalExpr * node ) { 1260 1241 VISIT_START( node ); 1261 1242 … … 1273 1254 //-------------------------------------------------------------------------- 1274 1255 // ConditionalExpr 1275 template< typename core_t >1276 const ast::Expr * ast::Pass< core_t >::visit( const ast::ConditionalExpr * node ) {1256 template< typename pass_t > 1257 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConditionalExpr * node ) { 1277 1258 VISIT_START( node ); 1278 1259 … … 1291 1272 //-------------------------------------------------------------------------- 1292 1273 // CommaExpr 1293 template< typename core_t >1294 const ast::Expr * ast::Pass< core_t >::visit( const ast::CommaExpr * node ) {1274 template< typename pass_t > 1275 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CommaExpr * node ) { 1295 1276 VISIT_START( node ); 1296 1277 … … 1308 1289 //-------------------------------------------------------------------------- 1309 1290 // TypeExpr 1310 template< typename core_t >1311 const ast::Expr * ast::Pass< core_t >::visit( const ast::TypeExpr * node ) {1291 template< typename pass_t > 1292 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TypeExpr * node ) { 1312 1293 VISIT_START( node ); 1313 1294 … … 1324 1305 //-------------------------------------------------------------------------- 1325 1306 // AsmExpr 1326 template< typename core_t >1327 const ast::Expr * ast::Pass< core_t >::visit( const ast::AsmExpr * node ) {1307 template< typename pass_t > 1308 const ast::Expr * ast::Pass< pass_t >::visit( const ast::AsmExpr * node ) { 1328 1309 VISIT_START( node ); 1329 1310 … … 1341 1322 //-------------------------------------------------------------------------- 1342 1323 // ImplicitCopyCtorExpr 1343 template< typename core_t >1344 const ast::Expr * ast::Pass< core_t >::visit( const ast::ImplicitCopyCtorExpr * node ) {1324 template< typename pass_t > 1325 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ImplicitCopyCtorExpr * node ) { 1345 1326 VISIT_START( node ); 1346 1327 … … 1357 1338 //-------------------------------------------------------------------------- 1358 1339 // ConstructorExpr 1359 template< typename core_t >1360 const ast::Expr * ast::Pass< core_t >::visit( const ast::ConstructorExpr * node ) {1340 template< typename pass_t > 1341 const ast::Expr * ast::Pass< pass_t >::visit( const ast::ConstructorExpr * node ) { 1361 1342 VISIT_START( node ); 1362 1343 … … 1373 1354 //-------------------------------------------------------------------------- 1374 1355 // CompoundLiteralExpr 1375 template< typename core_t >1376 const ast::Expr * ast::Pass< core_t >::visit( const ast::CompoundLiteralExpr * node ) {1356 template< typename pass_t > 1357 const ast::Expr * ast::Pass< pass_t >::visit( const ast::CompoundLiteralExpr * node ) { 1377 1358 VISIT_START( node ); 1378 1359 … … 1389 1370 //-------------------------------------------------------------------------- 1390 1371 // RangeExpr 1391 template< typename core_t >1392 const ast::Expr * ast::Pass< core_t >::visit( const ast::RangeExpr * node ) {1372 template< typename pass_t > 1373 const ast::Expr * ast::Pass< pass_t >::visit( const ast::RangeExpr * node ) { 1393 1374 VISIT_START( node ); 1394 1375 … … 1406 1387 //-------------------------------------------------------------------------- 1407 1388 // UntypedTupleExpr 1408 template< typename core_t >1409 const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedTupleExpr * node ) {1389 template< typename pass_t > 1390 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedTupleExpr * node ) { 1410 1391 VISIT_START( node ); 1411 1392 … … 1422 1403 //-------------------------------------------------------------------------- 1423 1404 // TupleExpr 1424 template< typename core_t >1425 const ast::Expr * ast::Pass< core_t >::visit( const ast::TupleExpr * node ) {1405 template< typename pass_t > 1406 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleExpr * node ) { 1426 1407 VISIT_START( node ); 1427 1408 … … 1438 1419 //-------------------------------------------------------------------------- 1439 1420 // TupleIndexExpr 1440 template< typename core_t >1441 const ast::Expr * ast::Pass< core_t >::visit( const ast::TupleIndexExpr * node ) {1421 template< typename pass_t > 1422 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleIndexExpr * node ) { 1442 1423 VISIT_START( node ); 1443 1424 … … 1454 1435 //-------------------------------------------------------------------------- 1455 1436 // TupleAssignExpr 1456 template< typename core_t >1457 const ast::Expr * ast::Pass< core_t >::visit( const ast::TupleAssignExpr * node ) {1437 template< typename pass_t > 1438 const ast::Expr * ast::Pass< pass_t >::visit( const ast::TupleAssignExpr * node ) { 1458 1439 VISIT_START( node ); 1459 1440 … … 1470 1451 //-------------------------------------------------------------------------- 1471 1452 // StmtExpr 1472 template< typename core_t >1473 const ast::Expr * ast::Pass< core_t >::visit( const ast::StmtExpr * node ) {1453 template< typename pass_t > 1454 const ast::Expr * ast::Pass< pass_t >::visit( const ast::StmtExpr * node ) { 1474 1455 VISIT_START( node ); 1475 1456 1476 1457 VISIT(// don't want statements from outer CompoundStmts to be added to this StmtExpr 1477 1458 // get the stmts that will need to be spliced in 1478 auto stmts_before = __pass::stmtsToAddBefore( core, 0);1479 auto stmts_after = __pass::stmtsToAddAfter ( core, 0);1459 auto stmts_before = __pass::stmtsToAddBefore( pass, 0); 1460 auto stmts_after = __pass::stmtsToAddAfter ( pass, 0); 1480 1461 1481 1462 // These may be modified by subnode but most be restored once we exit this statemnet. 1482 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::env( core, 0) );1463 ValueGuardPtr< const ast::TypeSubstitution * > __old_env( __pass::env( pass, 0) ); 1483 1464 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_before) >::type > __old_decls_before( stmts_before ); 1484 1465 ValueGuardPtr< typename std::remove_pointer< decltype(stmts_after ) >::type > __old_decls_after ( stmts_after ); … … 1498 1479 //-------------------------------------------------------------------------- 1499 1480 // UniqueExpr 1500 template< typename core_t >1501 const ast::Expr * ast::Pass< core_t >::visit( const ast::UniqueExpr * node ) {1481 template< typename pass_t > 1482 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UniqueExpr * node ) { 1502 1483 VISIT_START( node ); 1503 1484 … … 1514 1495 //-------------------------------------------------------------------------- 1515 1496 // UntypedInitExpr 1516 template< typename core_t >1517 const ast::Expr * ast::Pass< core_t >::visit( const ast::UntypedInitExpr * node ) {1497 template< typename pass_t > 1498 const ast::Expr * ast::Pass< pass_t >::visit( const ast::UntypedInitExpr * node ) { 1518 1499 VISIT_START( node ); 1519 1500 … … 1531 1512 //-------------------------------------------------------------------------- 1532 1513 // InitExpr 1533 template< typename core_t >1534 const ast::Expr * ast::Pass< core_t >::visit( const ast::InitExpr * node ) {1514 template< typename pass_t > 1515 const ast::Expr * ast::Pass< pass_t >::visit( const ast::InitExpr * node ) { 1535 1516 VISIT_START( node ); 1536 1517 … … 1548 1529 //-------------------------------------------------------------------------- 1549 1530 // DeletedExpr 1550 template< typename core_t >1551 const ast::Expr * ast::Pass< core_t >::visit( const ast::DeletedExpr * node ) {1531 template< typename pass_t > 1532 const ast::Expr * ast::Pass< pass_t >::visit( const ast::DeletedExpr * node ) { 1552 1533 VISIT_START( node ); 1553 1534 … … 1565 1546 //-------------------------------------------------------------------------- 1566 1547 // DefaultArgExpr 1567 template< typename core_t >1568 const ast::Expr * ast::Pass< core_t >::visit( const ast::DefaultArgExpr * node ) {1548 template< typename pass_t > 1549 const ast::Expr * ast::Pass< pass_t >::visit( const ast::DefaultArgExpr * node ) { 1569 1550 VISIT_START( node ); 1570 1551 … … 1581 1562 //-------------------------------------------------------------------------- 1582 1563 // GenericExpr 1583 template< typename core_t >1584 const ast::Expr * ast::Pass< core_t >::visit( const ast::GenericExpr * node ) {1564 template< typename pass_t > 1565 const ast::Expr * ast::Pass< pass_t >::visit( const ast::GenericExpr * node ) { 1585 1566 VISIT_START( node ); 1586 1567 … … 1621 1602 //-------------------------------------------------------------------------- 1622 1603 // VoidType 1623 template< typename core_t >1624 const ast::Type * ast::Pass< core_t >::visit( const ast::VoidType * node ) {1604 template< typename pass_t > 1605 const ast::Type * ast::Pass< pass_t >::visit( const ast::VoidType * node ) { 1625 1606 VISIT_START( node ); 1626 1607 … … 1630 1611 //-------------------------------------------------------------------------- 1631 1612 // BasicType 1632 template< typename core_t >1633 const ast::Type * ast::Pass< core_t >::visit( const ast::BasicType * node ) {1613 template< typename pass_t > 1614 const ast::Type * ast::Pass< pass_t >::visit( const ast::BasicType * node ) { 1634 1615 VISIT_START( node ); 1635 1616 … … 1639 1620 //-------------------------------------------------------------------------- 1640 1621 // PointerType 1641 template< typename core_t >1642 const ast::Type * ast::Pass< core_t >::visit( const ast::PointerType * node ) {1622 template< typename pass_t > 1623 const ast::Type * ast::Pass< pass_t >::visit( const ast::PointerType * node ) { 1643 1624 VISIT_START( node ); 1644 1625 … … 1653 1634 //-------------------------------------------------------------------------- 1654 1635 // ArrayType 1655 template< typename core_t >1656 const ast::Type * ast::Pass< core_t >::visit( const ast::ArrayType * node ) {1636 template< typename pass_t > 1637 const ast::Type * ast::Pass< pass_t >::visit( const ast::ArrayType * node ) { 1657 1638 VISIT_START( node ); 1658 1639 … … 1667 1648 //-------------------------------------------------------------------------- 1668 1649 // ReferenceType 1669 template< typename core_t >1670 const ast::Type * ast::Pass< core_t >::visit( const ast::ReferenceType * node ) {1650 template< typename pass_t > 1651 const ast::Type * ast::Pass< pass_t >::visit( const ast::ReferenceType * node ) { 1671 1652 VISIT_START( node ); 1672 1653 … … 1680 1661 //-------------------------------------------------------------------------- 1681 1662 // QualifiedType 1682 template< typename core_t >1683 const ast::Type * ast::Pass< core_t >::visit( const ast::QualifiedType * node ) {1663 template< typename pass_t > 1664 const ast::Type * ast::Pass< pass_t >::visit( const ast::QualifiedType * node ) { 1684 1665 VISIT_START( node ); 1685 1666 … … 1694 1675 //-------------------------------------------------------------------------- 1695 1676 // FunctionType 1696 template< typename core_t > 1697 const 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 ); 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 ); 1703 1683 maybe_accept( node, &FunctionType::returns ); 1704 1684 maybe_accept( node, &FunctionType::params ); 1705 })1685 ) 1706 1686 1707 1687 VISIT_END( Type, node ); … … 1710 1690 //-------------------------------------------------------------------------- 1711 1691 // StructInstType 1712 template< typename core_t >1713 const ast::Type * ast::Pass< core_t >::visit( const ast::StructInstType * node ) {1714 VISIT_START( node ); 1715 1716 __pass::symtab::addStruct( core, 0, node->name );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 ); 1717 1697 1718 1698 VISIT({ 1719 1699 guard_symtab guard { *this }; 1720 guard_forall_subs forall_guard { *this, node }; 1721 mutate_forall( node ); 1700 maybe_accept( node, &StructInstType::forall ); 1722 1701 maybe_accept( node, &StructInstType::params ); 1723 1702 }) … … 1728 1707 //-------------------------------------------------------------------------- 1729 1708 // UnionInstType 1730 template< typename core_t >1731 const ast::Type * ast::Pass< core_t >::visit( const ast::UnionInstType * node ) {1732 VISIT_START( node ); 1733 1734 __pass::symtab::add Union( core, 0, node->name );1735 1736 VISIT({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 { 1737 1716 guard_symtab guard { *this }; 1738 guard_forall_subs forall_guard { *this, node }; 1739 mutate_forall( node ); 1717 maybe_accept( node, &UnionInstType::forall ); 1740 1718 maybe_accept( node, &UnionInstType::params ); 1741 } )1719 } 1742 1720 1743 1721 VISIT_END( Type, node ); … … 1746 1724 //-------------------------------------------------------------------------- 1747 1725 // EnumInstType 1748 template< typename core_t > 1749 const 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 ); 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 ); 1755 1732 maybe_accept( node, &EnumInstType::params ); 1756 })1733 ) 1757 1734 1758 1735 VISIT_END( Type, node ); … … 1761 1738 //-------------------------------------------------------------------------- 1762 1739 // TraitInstType 1763 template< typename core_t > 1764 const 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 ); 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 ); 1770 1746 maybe_accept( node, &TraitInstType::params ); 1771 })1747 ) 1772 1748 1773 1749 VISIT_END( Type, node ); … … 1776 1752 //-------------------------------------------------------------------------- 1777 1753 // TypeInstType 1778 template< typename core_t > 1779 const 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 ); 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 ); 1790 1761 ) 1791 1762 … … 1795 1766 //-------------------------------------------------------------------------- 1796 1767 // TupleType 1797 template< typename core_t >1798 const ast::Type * ast::Pass< core_t >::visit( const ast::TupleType * node ) {1768 template< typename pass_t > 1769 const ast::Type * ast::Pass< pass_t >::visit( const ast::TupleType * node ) { 1799 1770 VISIT_START( node ); 1800 1771 … … 1809 1780 //-------------------------------------------------------------------------- 1810 1781 // TypeofType 1811 template< typename core_t >1812 const ast::Type * ast::Pass< core_t >::visit( const ast::TypeofType * node ) {1782 template< typename pass_t > 1783 const ast::Type * ast::Pass< pass_t >::visit( const ast::TypeofType * node ) { 1813 1784 VISIT_START( node ); 1814 1785 … … 1822 1793 //-------------------------------------------------------------------------- 1823 1794 // VarArgsType 1824 template< typename core_t >1825 const ast::Type * ast::Pass< core_t >::visit( const ast::VarArgsType * node ) {1795 template< typename pass_t > 1796 const ast::Type * ast::Pass< pass_t >::visit( const ast::VarArgsType * node ) { 1826 1797 VISIT_START( node ); 1827 1798 … … 1831 1802 //-------------------------------------------------------------------------- 1832 1803 // ZeroType 1833 template< typename core_t >1834 const ast::Type * ast::Pass< core_t >::visit( const ast::ZeroType * node ) {1804 template< typename pass_t > 1805 const ast::Type * ast::Pass< pass_t >::visit( const ast::ZeroType * node ) { 1835 1806 VISIT_START( node ); 1836 1807 … … 1840 1811 //-------------------------------------------------------------------------- 1841 1812 // OneType 1842 template< typename core_t >1843 const ast::Type * ast::Pass< core_t >::visit( const ast::OneType * node ) {1813 template< typename pass_t > 1814 const ast::Type * ast::Pass< pass_t >::visit( const ast::OneType * node ) { 1844 1815 VISIT_START( node ); 1845 1816 … … 1849 1820 //-------------------------------------------------------------------------- 1850 1821 // GlobalScopeType 1851 template< typename core_t >1852 const ast::Type * ast::Pass< core_t >::visit( const ast::GlobalScopeType * node ) {1822 template< typename pass_t > 1823 const ast::Type * ast::Pass< pass_t >::visit( const ast::GlobalScopeType * node ) { 1853 1824 VISIT_START( node ); 1854 1825 … … 1859 1830 //-------------------------------------------------------------------------- 1860 1831 // Designation 1861 template< typename core_t >1862 const ast::Designation * ast::Pass< core_t >::visit( const ast::Designation * node ) {1832 template< typename pass_t > 1833 const ast::Designation * ast::Pass< pass_t >::visit( const ast::Designation * node ) { 1863 1834 VISIT_START( node ); 1864 1835 … … 1870 1841 //-------------------------------------------------------------------------- 1871 1842 // SingleInit 1872 template< typename core_t >1873 const ast::Init * ast::Pass< core_t >::visit( const ast::SingleInit * node ) {1843 template< typename pass_t > 1844 const ast::Init * ast::Pass< pass_t >::visit( const ast::SingleInit * node ) { 1874 1845 VISIT_START( node ); 1875 1846 … … 1883 1854 //-------------------------------------------------------------------------- 1884 1855 // ListInit 1885 template< typename core_t >1886 const ast::Init * ast::Pass< core_t >::visit( const ast::ListInit * node ) {1856 template< typename pass_t > 1857 const ast::Init * ast::Pass< pass_t >::visit( const ast::ListInit * node ) { 1887 1858 VISIT_START( node ); 1888 1859 … … 1897 1868 //-------------------------------------------------------------------------- 1898 1869 // ConstructorInit 1899 template< typename core_t >1900 const ast::Init * ast::Pass< core_t >::visit( const ast::ConstructorInit * node ) {1870 template< typename pass_t > 1871 const ast::Init * ast::Pass< pass_t >::visit( const ast::ConstructorInit * node ) { 1901 1872 VISIT_START( node ); 1902 1873 … … 1912 1883 //-------------------------------------------------------------------------- 1913 1884 // Attribute 1914 template< typename core_t >1915 const ast::Attribute * ast::Pass< core_t >::visit( const ast::Attribute * node ) {1885 template< typename pass_t > 1886 const ast::Attribute * ast::Pass< pass_t >::visit( const ast::Attribute * node ) { 1916 1887 VISIT_START( node ); 1917 1888 … … 1925 1896 //-------------------------------------------------------------------------- 1926 1897 // TypeSubstitution 1927 template< typename core_t >1928 const ast::TypeSubstitution * ast::Pass< core_t >::visit( const ast::TypeSubstitution * node ) {1898 template< typename pass_t > 1899 const ast::TypeSubstitution * ast::Pass< pass_t >::visit( const ast::TypeSubstitution * node ) { 1929 1900 VISIT_START( node ); 1930 1901 … … 1936 1907 guard_symtab guard { *this }; 1937 1908 auto new_node = p.second->accept( *this ); 1938 if (new_node != p.second) mutated = true;1909 if (new_node != p.second) mutated = false; 1939 1910 new_map.insert({ p.first, new_node }); 1940 1911 } … … 1952 1923 guard_symtab guard { *this }; 1953 1924 auto new_node = p.second->accept( *this ); 1954 if (new_node != p.second) mutated = true;1925 if (new_node != p.second) mutated = false; 1955 1926 new_map.insert({ p.first, new_node }); 1956 1927 }
Note:
See TracChangeset
for help on using the changeset viewer.