Changes in src/AST/Pass.impl.hpp [e61207e7:c671112]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.impl.hpp
re61207e7 rc671112 19 19 #include <type_traits> 20 20 #include <unordered_map> 21 22 #include "AST/TypeSubstitution.hpp" 21 23 22 24 #define VISIT_START( node ) \ … … 462 464 VISIT({ 463 465 guard_indexer guard { * this }; 464 maybe_accept( node, &StructDecl::params 465 maybe_accept( node, &StructDecl::members );466 maybe_accept( node, &StructDecl::params ); 467 maybe_accept( node, &StructDecl::members ); 466 468 }) 467 469 … … 483 485 VISIT({ 484 486 guard_indexer guard { * this }; 485 maybe_accept( node, &UnionDecl::params 486 maybe_accept( node, &UnionDecl::members );487 maybe_accept( node, &UnionDecl::params ); 488 maybe_accept( node, &UnionDecl::members ); 487 489 }) 488 490 … … 502 504 VISIT( 503 505 // unlike structs, traits, and unions, enums inject their members into the global scope 504 maybe_accept( node, &EnumDecl::params 505 maybe_accept( node, &EnumDecl::members );506 maybe_accept( node, &EnumDecl::params ); 507 maybe_accept( node, &EnumDecl::members ); 506 508 ) 507 509 … … 517 519 VISIT({ 518 520 guard_indexer guard { *this }; 519 maybe_accept( node, &TraitDecl::params 520 maybe_accept( node, &TraitDecl::members );521 maybe_accept( node, &TraitDecl::params ); 522 maybe_accept( node, &TraitDecl::members ); 521 523 }) 522 524 … … 535 537 guard_indexer guard { *this }; 536 538 maybe_accept( node, &TypeDecl::params ); 537 maybe_accept( node, &TypeDecl::base );539 maybe_accept( node, &TypeDecl::base ); 538 540 }) 539 541 … … 564 566 guard_indexer guard { *this }; 565 567 maybe_accept( node, &TypedefDecl::params ); 566 maybe_accept( node, &TypedefDecl::base );568 maybe_accept( node, &TypedefDecl::base ); 567 569 }) 568 570 … … 688 690 maybe_accept( node, &WhileStmt::body ); 689 691 }) 690 691 VISIT_END( Stmt, node );692 }693 694 //--------------------------------------------------------------------------695 // ForStmt696 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 // SwitchStmt714 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 // CaseStmt728 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 // BranchStmt742 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 // ReturnStmt750 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 // ThrowStmt763 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 // TryStmt777 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 )786 692 787 693 VISIT_END( Stmt, node );
Note: See TracChangeset
for help on using the changeset viewer.