Changeset 246c245 for src/AST/Pass.impl.hpp
- Timestamp:
- May 16, 2019, 6:51:18 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 8ff178d, d66e7b7
- Parents:
- 9b4f329 (diff), 6f8e87d (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. - File:
-
- 1 edited
-
src/AST/Pass.impl.hpp (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Pass.impl.hpp
r9b4f329 r246c245 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::param eters);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::param eters);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::param eters);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::param eters);520 maybe_accept( node, &TraitDecl::members );521 maybe_accept( node, &TraitDecl::params ); 522 maybe_accept( node, &TraitDecl::members ); 521 523 }) 522 524 … … 534 536 VISIT({ 535 537 guard_indexer guard { *this }; 536 maybe_accept( node, &TypeDecl::param eters );537 maybe_accept( node, &TypeDecl::base );538 maybe_accept( node, &TypeDecl::params ); 539 maybe_accept( node, &TypeDecl::base ); 538 540 }) 539 541 … … 563 565 VISIT({ 564 566 guard_indexer guard { *this }; 565 maybe_accept( node, &TypedefDecl::param eters );566 maybe_accept( node, &TypedefDecl::base );567 maybe_accept( node, &TypedefDecl::params ); 568 maybe_accept( node, &TypedefDecl::base ); 567 569 }) 568 570 … … 688 690 maybe_accept( node, &WhileStmt::body ); 689 691 }) 692 693 VISIT_END( Stmt, node ); 694 } 695 696 //-------------------------------------------------------------------------- 697 // ForStmt 698 template< typename pass_t > 699 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ForStmt * node ) { 700 VISIT_START( node ); 701 702 VISIT({ 703 // for statements introduce a level of scope (for the initialization) 704 guard_indexer guard { *this }; 705 maybe_accept( node, &ForStmt::inits ); 706 maybe_accept( node, &ForStmt::cond ); 707 maybe_accept( node, &ForStmt::inc ); 708 maybe_accept( node, &ForStmt::body ); 709 }) 710 711 VISIT_END( Stmt, node ); 712 } 713 714 //-------------------------------------------------------------------------- 715 // SwitchStmt 716 template< typename pass_t > 717 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::SwitchStmt * node ) { 718 VISIT_START( node ); 719 720 VISIT( 721 maybe_accept( node, &SwitchStmt::cond ); 722 maybe_accept( node, &SwitchStmt::stmts ); 723 ) 724 725 VISIT_END( Stmt, node ); 726 } 727 728 //-------------------------------------------------------------------------- 729 // CaseStmt 730 template< typename pass_t > 731 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::CaseStmt * node ) { 732 VISIT_START( node ); 733 734 VISIT( 735 maybe_accept( node, &CaseStmt::cond ); 736 maybe_accept( node, &CaseStmt::stmts ); 737 ) 738 739 VISIT_END( Stmt, node ); 740 } 741 742 //-------------------------------------------------------------------------- 743 // BranchStmt 744 template< typename pass_t > 745 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::BranchStmt * node ) { 746 VISIT_START( node ); 747 VISIT_END( Stmt, node ); 748 } 749 750 //-------------------------------------------------------------------------- 751 // ReturnStmt 752 template< typename pass_t > 753 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ReturnStmt * node ) { 754 VISIT_START( node ); 755 756 VISIT( 757 maybe_accept( node, &ReturnStmt::expr ); 758 ) 759 760 VISIT_END( Stmt, node ); 761 } 762 763 //-------------------------------------------------------------------------- 764 // ThrowStmt 765 template< typename pass_t > 766 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ThrowStmt * node ) { 767 VISIT_START( node ); 768 769 VISIT( 770 maybe_accept( node, &ThrowStmt::expr ); 771 maybe_accept( node, &ThrowStmt::target ); 772 ) 773 774 VISIT_END( Stmt, node ); 775 } 776 777 //-------------------------------------------------------------------------- 778 // TryStmt 779 template< typename pass_t > 780 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::TryStmt * node ) { 781 VISIT_START( node ); 782 783 VISIT( 784 maybe_accept( node, &TryStmt::body ); 785 maybe_accept( node, &TryStmt::handlers ); 786 maybe_accept( node, &TryStmt::finally ); 787 ) 690 788 691 789 VISIT_END( Stmt, node );
Note:
See TracChangeset
for help on using the changeset viewer.