Changes in src/AST/Pass.impl.hpp [c671112:e61207e7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.impl.hpp
rc671112 re61207e7 19 19 #include <type_traits> 20 20 #include <unordered_map> 21 22 #include "AST/TypeSubstitution.hpp"23 21 24 22 #define VISIT_START( node ) \ … … 464 462 VISIT({ 465 463 guard_indexer guard { * this }; 466 maybe_accept( node, &StructDecl::params );467 maybe_accept( node, &StructDecl::members 464 maybe_accept( node, &StructDecl::params ); 465 maybe_accept( node, &StructDecl::members ); 468 466 }) 469 467 … … 485 483 VISIT({ 486 484 guard_indexer guard { * this }; 487 maybe_accept( node, &UnionDecl::params );488 maybe_accept( node, &UnionDecl::members 485 maybe_accept( node, &UnionDecl::params ); 486 maybe_accept( node, &UnionDecl::members ); 489 487 }) 490 488 … … 504 502 VISIT( 505 503 // unlike structs, traits, and unions, enums inject their members into the global scope 506 maybe_accept( node, &EnumDecl::params );507 maybe_accept( node, &EnumDecl::members 504 maybe_accept( node, &EnumDecl::params ); 505 maybe_accept( node, &EnumDecl::members ); 508 506 ) 509 507 … … 519 517 VISIT({ 520 518 guard_indexer guard { *this }; 521 maybe_accept( node, &TraitDecl::params );522 maybe_accept( node, &TraitDecl::members 519 maybe_accept( node, &TraitDecl::params ); 520 maybe_accept( node, &TraitDecl::members ); 523 521 }) 524 522 … … 537 535 guard_indexer guard { *this }; 538 536 maybe_accept( node, &TypeDecl::params ); 539 maybe_accept( node, &TypeDecl::base 537 maybe_accept( node, &TypeDecl::base ); 540 538 }) 541 539 … … 566 564 guard_indexer guard { *this }; 567 565 maybe_accept( node, &TypedefDecl::params ); 568 maybe_accept( node, &TypedefDecl::base 566 maybe_accept( node, &TypedefDecl::base ); 569 567 }) 570 568 … … 690 688 maybe_accept( node, &WhileStmt::body ); 691 689 }) 690 691 VISIT_END( Stmt, node ); 692 } 693 694 //-------------------------------------------------------------------------- 695 // ForStmt 696 template< typename pass_t > 697 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ForStmt * node ) { 698 VISIT_START( node ); 699 700 VISIT({ 701 // for statements introduce a level of scope (for the initialization) 702 guard_indexer guard { *this }; 703 maybe_accept( node, &ForStmt::inits ); 704 maybe_accept( node, &ForStmt::cond ); 705 maybe_accept( node, &ForStmt::inc ); 706 maybe_accept( node, &ForStmt::body ); 707 }) 708 709 VISIT_END( Stmt, node ); 710 } 711 712 //-------------------------------------------------------------------------- 713 // SwitchStmt 714 template< typename pass_t > 715 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::SwitchStmt * node ) { 716 VISIT_START( node ); 717 718 VISIT( 719 maybe_accept( node, &SwitchStmt::cond ); 720 maybe_accept( node, &SwitchStmt::stmts ); 721 ) 722 723 VISIT_END( Stmt, node ); 724 } 725 726 //-------------------------------------------------------------------------- 727 // CaseStmt 728 template< typename pass_t > 729 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::CaseStmt * node ) { 730 VISIT_START( node ); 731 732 VISIT( 733 maybe_accept( node, &CaseStmt::cond ); 734 maybe_accept( node, &CaseStmt::stmts ); 735 ) 736 737 VISIT_END( Stmt, node ); 738 } 739 740 //-------------------------------------------------------------------------- 741 // BranchStmt 742 template< typename pass_t > 743 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::BranchStmt * node ) { 744 VISIT_START( node ); 745 VISIT_END( Stmt, node ); 746 } 747 748 //-------------------------------------------------------------------------- 749 // ReturnStmt 750 template< typename pass_t > 751 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ReturnStmt * node ) { 752 VISIT_START( node ); 753 754 VISIT( 755 maybe_accept( node, &ReturnStmt::expr ); 756 ) 757 758 VISIT_END( Stmt, node ); 759 } 760 761 //-------------------------------------------------------------------------- 762 // ThrowStmt 763 template< typename pass_t > 764 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ThrowStmt * node ) { 765 VISIT_START( node ); 766 767 VISIT( 768 maybe_accept( node, &ThrowStmt::expr ); 769 maybe_accept( node, &ThrowStmt::target ); 770 ) 771 772 VISIT_END( Stmt, node ); 773 } 774 775 //-------------------------------------------------------------------------- 776 // TryStmt 777 template< typename pass_t > 778 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::TryStmt * node ) { 779 VISIT_START( node ); 780 781 VISIT( 782 maybe_accept( node, &TryStmt::block ); 783 maybe_accept( node, &TryStmt::handlers ); 784 maybe_accept( node, &TryStmt::finallyBlock ); 785 ) 692 786 693 787 VISIT_END( Stmt, node );
Note: See TracChangeset
for help on using the changeset viewer.