Ignore:
File:
1 edited

Legend:

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

    r6b2d444 re21f253  
    3333        /* call the implementation of the previsit of this pass */ \
    3434        __pass::previsit( core, node, 0 );
    35 
    36 #define VISIT( code... ) \
    37         /* if this node should visit its children */ \
    38         if ( __visit_children() ) { \
    39                 /* visit the children */ \
    40                 code \
    41         }
    4235
    4336#define VISIT_END( type, node ) \
     
    452445        VISIT_START( node );
    453446
    454         VISIT(
     447        if ( __visit_children() ) {
    455448                {
    456449                        guard_symtab guard { *this };
     
    460453                maybe_accept( node, &ObjectDecl::bitfieldWidth );
    461454                maybe_accept( node, &ObjectDecl::attributes    );
    462         )
     455        }
    463456
    464457        __pass::symtab::addId( core, 0, node );
     
    475468        __pass::symtab::addId( core, 0, node );
    476469
    477         VISIT(maybe_accept( node, &FunctionDecl::withExprs );)
     470        if ( __visit_children() ) {
     471                maybe_accept( node, &FunctionDecl::withExprs );
     472        }
    478473        {
    479474                // with clause introduces a level of scope (for the with expression members).
     
    493488                        } };
    494489                        __pass::symtab::addId( core, 0, func );
    495                         VISIT(
     490                        if ( __visit_children() ) {
    496491                                // parameter declarations
    497492                                maybe_accept( node, &FunctionDecl::params );
     
    509504                                maybe_accept( node, &FunctionDecl::stmts );
    510505                                maybe_accept( node, &FunctionDecl::attributes );
    511                         )
     506                        }
    512507                }
    513508        }
     
    526521        __pass::symtab::addStructFwd( core, 0, node );
    527522
    528         VISIT({
     523        if ( __visit_children() ) {
    529524                guard_symtab guard { * this };
    530525                maybe_accept( node, &StructDecl::params     );
    531526                maybe_accept( node, &StructDecl::members    );
    532527                maybe_accept( node, &StructDecl::attributes );
    533         })
     528        }
    534529
    535530        // this addition replaces the forward declaration
     
    548543        __pass::symtab::addUnionFwd( core, 0, node );
    549544
    550         VISIT({
     545        if ( __visit_children() ) {
    551546                guard_symtab guard { * this };
    552547                maybe_accept( node, &UnionDecl::params     );
    553548                maybe_accept( node, &UnionDecl::members    );
    554549                maybe_accept( node, &UnionDecl::attributes );
    555         })
     550        }
    556551
    557552        __pass::symtab::addUnion( core, 0, node );
     
    568563        __pass::symtab::addEnum( core, 0, node );
    569564
    570         VISIT(
     565        if ( __visit_children() ) {
    571566                // unlike structs, traits, and unions, enums inject their members into the global scope
    572567                maybe_accept( node, &EnumDecl::params     );
    573568                maybe_accept( node, &EnumDecl::members    );
    574569                maybe_accept( node, &EnumDecl::attributes );
    575         )
     570        }
    576571
    577572        VISIT_END( Decl, node );
     
    584579        VISIT_START( node );
    585580
    586         VISIT({
     581        if ( __visit_children() ) {
    587582                guard_symtab guard { *this };
    588583                maybe_accept( node, &TraitDecl::params     );
    589584                maybe_accept( node, &TraitDecl::members    );
    590585                maybe_accept( node, &TraitDecl::attributes );
    591         })
     586        }
    592587
    593588        __pass::symtab::addTrait( core, 0, node );
     
    602597        VISIT_START( node );
    603598
    604         VISIT({
     599        if ( __visit_children() ) {
    605600                guard_symtab guard { *this };
    606601                maybe_accept( node, &TypeDecl::base   );
    607         })
     602        }
    608603
    609604        // see A NOTE ON THE ORDER OF TRAVERSAL, above
     
    612607        __pass::symtab::addType( core, 0, node );
    613608
    614         VISIT(
     609        if ( __visit_children() ) {
    615610                maybe_accept( node, &TypeDecl::assertions );
    616611
     
    619614                        maybe_accept( node, &TypeDecl::init );
    620615                }
    621         )
     616        }
    622617
    623618        VISIT_END( Decl, node );
     
    630625        VISIT_START( node );
    631626
    632         VISIT({
     627        if ( __visit_children() ) {
    633628                guard_symtab guard { *this };
    634629                maybe_accept( node, &TypedefDecl::base   );
    635         })
     630        }
    636631
    637632        __pass::symtab::addType( core, 0, node );
    638633
    639         VISIT( maybe_accept( node, &TypedefDecl::assertions ); )
     634        if ( __visit_children() ) {
     635                maybe_accept( node, &TypedefDecl::assertions );
     636        }
    640637
    641638        VISIT_END( Decl, node );
     
    648645        VISIT_START( node );
    649646
    650         VISIT(
     647        if ( __visit_children() ) {
    651648                maybe_accept( node, &AsmDecl::stmt );
    652         )
     649        }
    653650
    654651        VISIT_END( AsmDecl, node );
     
    661658        VISIT_START( node );
    662659
    663         VISIT(
     660        if ( __visit_children() ) {
    664661                maybe_accept( node, &DirectiveDecl::stmt );
    665         )
     662        }
    666663
    667664        VISIT_END( DirectiveDecl, node );
     
    674671        VISIT_START( node );
    675672
    676         VISIT(
     673        if ( __visit_children() ) {
    677674                maybe_accept( node, &StaticAssertDecl::cond );
    678675                maybe_accept( node, &StaticAssertDecl::msg  );
    679         )
     676        }
    680677
    681678        VISIT_END( StaticAssertDecl, node );
     
    687684const ast::CompoundStmt * ast::Pass< core_t >::visit( const ast::CompoundStmt * node ) {
    688685        VISIT_START( node );
    689         VISIT(
     686
     687        if ( __visit_children() ) {
    690688                // Do not enter (or leave) a new scope if atFunctionTop. Remember to save the result.
    691689                auto guard1 = makeFuncGuard( [this, enterScope = !this->atFunctionTop]() {
     
    704702                guard_scope guard3 { *this };
    705703                maybe_accept( node, &CompoundStmt::kids );
    706         )
     704        }
     705
    707706        VISIT_END( CompoundStmt, node );
    708707}
     
    714713        VISIT_START( node );
    715714
    716         VISIT(
     715        if ( __visit_children() ) {
    717716                maybe_accept( node, &ExprStmt::expr );
    718         )
     717        }
    719718
    720719        VISIT_END( Stmt, node );
     
    727726        VISIT_START( node )
    728727
    729         VISIT(
     728        if ( __visit_children() ) {
    730729                maybe_accept( node, &AsmStmt::instruction );
    731730                maybe_accept( node, &AsmStmt::output      );
    732731                maybe_accept( node, &AsmStmt::input       );
    733732                maybe_accept( node, &AsmStmt::clobber     );
    734         )
     733        }
    735734
    736735        VISIT_END( Stmt, node );
     
    752751        VISIT_START( node );
    753752
    754         VISIT({
     753        if ( __visit_children() ) {
    755754                // if statements introduce a level of scope (for the initialization)
    756755                guard_symtab guard { *this };
     
    759758                maybe_accept_as_compound( node, &IfStmt::thenPart );
    760759                maybe_accept_as_compound( node, &IfStmt::elsePart );
    761         })
     760        }
    762761
    763762        VISIT_END( Stmt, node );
     
    770769        VISIT_START( node );
    771770
    772         VISIT({
     771        if ( __visit_children() ) {
    773772                // while statements introduce a level of scope (for the initialization)
    774773                guard_symtab guard { *this };
     
    776775                maybe_accept( node, &WhileStmt::cond  );
    777776                maybe_accept_as_compound( node, &WhileStmt::body  );
    778         })
     777        }
    779778
    780779        VISIT_END( Stmt, node );
     
    787786        VISIT_START( node );
    788787
    789         VISIT({
     788        if ( __visit_children() ) {
    790789                // for statements introduce a level of scope (for the initialization)
    791790                guard_symtab guard { *this };
     
    795794                maybe_accept( node, &ForStmt::inc   );
    796795                maybe_accept_as_compound( node, &ForStmt::body  );
    797         })
     796        }
    798797
    799798        VISIT_END( Stmt, node );
     
    806805        VISIT_START( node );
    807806
    808         VISIT(
     807        if ( __visit_children() ) {
    809808                maybe_accept( node, &SwitchStmt::cond  );
    810809                maybe_accept( node, &SwitchStmt::stmts );
    811         )
     810        }
    812811
    813812        VISIT_END( Stmt, node );
     
    820819        VISIT_START( node );
    821820
    822         VISIT(
     821        if ( __visit_children() ) {
    823822                maybe_accept( node, &CaseStmt::cond  );
    824823                maybe_accept( node, &CaseStmt::stmts );
    825         )
     824        }
    826825
    827826        VISIT_END( Stmt, node );
     
    842841        VISIT_START( node );
    843842
    844         VISIT(
     843        if ( __visit_children() ) {
    845844                maybe_accept( node, &ReturnStmt::expr );
    846         )
     845        }
    847846
    848847        VISIT_END( Stmt, node );
     
    855854        VISIT_START( node );
    856855
    857         VISIT(
     856        if ( __visit_children() ) {
    858857                maybe_accept( node, &ThrowStmt::expr   );
    859858                maybe_accept( node, &ThrowStmt::target );
    860         )
     859        }
    861860
    862861        VISIT_END( Stmt, node );
     
    869868        VISIT_START( node );
    870869
    871         VISIT(
     870        if ( __visit_children() ) {
    872871                maybe_accept( node, &TryStmt::body     );
    873872                maybe_accept( node, &TryStmt::handlers );
    874873                maybe_accept( node, &TryStmt::finally  );
    875         )
     874        }
    876875
    877876        VISIT_END( Stmt, node );
     
    884883        VISIT_START( node );
    885884
    886         VISIT({
     885        if ( __visit_children() ) {
    887886                // catch statements introduce a level of scope (for the caught exception)
    888887                guard_symtab guard { *this };
     
    890889                maybe_accept( node, &CatchStmt::cond );
    891890                maybe_accept_as_compound( node, &CatchStmt::body );
    892         })
     891        }
    893892
    894893        VISIT_END( Stmt, node );
     
    901900        VISIT_START( node );
    902901
    903         VISIT(
     902        if ( __visit_children() ) {
    904903                maybe_accept( node, &FinallyStmt::body );
    905         )
     904        }
    906905
    907906        VISIT_END( Stmt, node );
     
    914913        VISIT_START( node );
    915914
    916         VISIT(
     915        if ( __visit_children() ) {
    917916                maybe_accept( node, &SuspendStmt::then   );
    918         )
     917        }
    919918
    920919        VISIT_END( Stmt, node );
     
    934933                // }
    935934
    936         VISIT({
     935        if ( __visit_children() ) {
    937936                std::vector<WaitForStmt::Clause> new_clauses;
    938937                new_clauses.reserve( node->clauses.size() );
     
    965964                        node = n;
    966965                }
    967         })
     966        }
    968967
    969968        #define maybe_accept(field) \
     
    977976                }
    978977
    979         VISIT(
     978        if ( __visit_children() ) {
    980979                maybe_accept( timeout.time );
    981980                maybe_accept( timeout.stmt );
     
    983982                maybe_accept( orElse.stmt  );
    984983                maybe_accept( orElse.cond  );
    985         )
     984        }
    986985
    987986        #undef maybe_accept
     
    996995        VISIT_START( node );
    997996
    998         VISIT(
     997        if ( __visit_children() ) {
    999998                maybe_accept( node, &WithStmt::exprs );
    1000999                {
     
    10041003                        maybe_accept( node, &WithStmt::stmt );
    10051004                }
    1006         )
     1005        }
     1006
    10071007        VISIT_END( Stmt, node );
    10081008}
     
    10221022        VISIT_START( node );
    10231023
    1024         VISIT(
     1024        if ( __visit_children() ) {
    10251025                maybe_accept( node, &DeclStmt::decl );
    1026         )
     1026        }
    10271027
    10281028        VISIT_END( Stmt, node );
     
    10371037        // For now this isn't visited, it is unclear if this causes problem
    10381038        // if all tests are known to pass, remove this code
    1039         VISIT(
     1039        if ( __visit_children() ) {
    10401040                maybe_accept( node, &ImplicitCtorDtorStmt::callStmt );
    1041         )
     1041        }
    10421042
    10431043        VISIT_END( Stmt, node );
     
    10501050        VISIT_START( node );
    10511051
    1052         VISIT(
     1052        if ( __visit_children() ) {
     1053                // mutex statements introduce a level of scope (for the initialization)
     1054                guard_symtab guard { *this };
     1055                maybe_accept( node, &MutexStmt::stmt );
    10531056                maybe_accept( node, &MutexStmt::mutexObjs );
    1054                 {
    1055                         // mutex statements introduce a level of scope (for the initialization)
    1056                         guard_symtab guard { *this };
    1057                         maybe_accept( node, &MutexStmt::stmt );
    1058                        
    1059                 }
    1060         )
     1057        }
    10611058
    10621059        VISIT_END( Stmt, node );
     
    10691066        VISIT_START( node );
    10701067
    1071         VISIT(
     1068        if ( __visit_children() ) {
    10721069                {
    10731070                        guard_symtab guard { *this };
     
    10761073                maybe_accept( node, &ApplicationExpr::func );
    10771074                maybe_accept( node, &ApplicationExpr::args );
    1078         )
     1075        }
    10791076
    10801077        VISIT_END( Expr, node );
     
    10871084        VISIT_START( node );
    10881085
    1089         VISIT(
     1086        if ( __visit_children() ) {
    10901087                {
    10911088                        guard_symtab guard { *this };
     
    10941091
    10951092                maybe_accept( node, &UntypedExpr::args );
    1096         )
     1093        }
    10971094
    10981095        VISIT_END( Expr, node );
     
    11051102        VISIT_START( node );
    11061103
    1107         VISIT({
     1104        if ( __visit_children() ) {
    11081105                guard_symtab guard { *this };
    11091106                maybe_accept( node, &NameExpr::result );
    1110         })
     1107        }
    11111108
    11121109        VISIT_END( Expr, node );
     
    11191116        VISIT_START( node );
    11201117
    1121         VISIT({
     1118        if ( __visit_children() ) {
     1119                {
    11221120                        guard_symtab guard { *this };
    11231121                        maybe_accept( node, &CastExpr::result );
    11241122                }
    11251123                maybe_accept( node, &CastExpr::arg );
    1126         )
     1124        }
    11271125
    11281126        VISIT_END( Expr, node );
     
    11351133        VISIT_START( node );
    11361134
    1137         VISIT({
     1135        if ( __visit_children() ) {
     1136                {
    11381137                        guard_symtab guard { *this };
    11391138                        maybe_accept( node, &KeywordCastExpr::result );
    11401139                }
    11411140                maybe_accept( node, &KeywordCastExpr::arg );
    1142         )
     1141        }
    11431142
    11441143        VISIT_END( Expr, node );
     
    11511150        VISIT_START( node );
    11521151
    1153         VISIT({
     1152        if ( __visit_children() ) {
     1153                {
    11541154                        guard_symtab guard { *this };
    11551155                        maybe_accept( node, &VirtualCastExpr::result );
    11561156                }
    11571157                maybe_accept( node, &VirtualCastExpr::arg );
    1158         )
     1158        }
    11591159
    11601160        VISIT_END( Expr, node );
     
    11671167        VISIT_START( node );
    11681168
    1169         VISIT({
     1169        if ( __visit_children() ) {
     1170                {
    11701171                        guard_symtab guard { *this };
    11711172                        maybe_accept( node, &AddressExpr::result );
    11721173                }
    11731174                maybe_accept( node, &AddressExpr::arg );
    1174         )
     1175        }
    11751176
    11761177        VISIT_END( Expr, node );
     
    11831184        VISIT_START( node );
    11841185
    1185         VISIT({
     1186        if ( __visit_children() ) {
    11861187                guard_symtab guard { *this };
    11871188                maybe_accept( node, &LabelAddressExpr::result );
    1188         })
     1189        }
    11891190
    11901191        VISIT_END( Expr, node );
     
    11971198        VISIT_START( node );
    11981199
    1199         VISIT({
     1200        if ( __visit_children() ) {
     1201                {
    12001202                        guard_symtab guard { *this };
    12011203                        maybe_accept( node, &UntypedMemberExpr::result );
     
    12031205                maybe_accept( node, &UntypedMemberExpr::aggregate );
    12041206                maybe_accept( node, &UntypedMemberExpr::member    );
    1205         )
     1207        }
    12061208
    12071209        VISIT_END( Expr, node );
     
    12141216        VISIT_START( node );
    12151217
    1216         VISIT({
     1218        if ( __visit_children() ) {
     1219                {
    12171220                        guard_symtab guard { *this };
    12181221                        maybe_accept( node, &MemberExpr::result );
    12191222                }
    12201223                maybe_accept( node, &MemberExpr::aggregate );
    1221         )
     1224        }
    12221225
    12231226        VISIT_END( Expr, node );
     
    12301233        VISIT_START( node );
    12311234
    1232         VISIT({
     1235        if ( __visit_children() ) {
    12331236                guard_symtab guard { *this };
    12341237                maybe_accept( node, &VariableExpr::result );
    1235         })
     1238        }
    12361239
    12371240        VISIT_END( Expr, node );
     
    12441247        VISIT_START( node );
    12451248
    1246         VISIT({
     1249        if ( __visit_children() ) {
    12471250                guard_symtab guard { *this };
    12481251                maybe_accept( node, &ConstantExpr::result );
    1249         })
     1252        }
    12501253
    12511254        VISIT_END( Expr, node );
     
    12581261        VISIT_START( node );
    12591262
    1260         VISIT({
     1263        if ( __visit_children() ) {
     1264                {
    12611265                        guard_symtab guard { *this };
    12621266                        maybe_accept( node, &SizeofExpr::result );
     
    12671271                        maybe_accept( node, &SizeofExpr::expr );
    12681272                }
    1269         )
     1273        }
    12701274
    12711275        VISIT_END( Expr, node );
     
    12781282        VISIT_START( node );
    12791283
    1280         VISIT({
     1284        if ( __visit_children() ) {
     1285                {
    12811286                        guard_symtab guard { *this };
    12821287                        maybe_accept( node, &AlignofExpr::result );
     
    12871292                        maybe_accept( node, &AlignofExpr::expr );
    12881293                }
    1289         )
     1294        }
    12901295
    12911296        VISIT_END( Expr, node );
     
    12981303        VISIT_START( node );
    12991304
    1300         VISIT({
     1305        if ( __visit_children() ) {
     1306                {
    13011307                        guard_symtab guard { *this };
    13021308                        maybe_accept( node, &UntypedOffsetofExpr::result );
    13031309                }
    13041310                maybe_accept( node, &UntypedOffsetofExpr::type   );
    1305         )
     1311        }
    13061312
    13071313        VISIT_END( Expr, node );
     
    13141320        VISIT_START( node );
    13151321
    1316         VISIT({
     1322        if ( __visit_children() ) {
     1323                {
    13171324                        guard_symtab guard { *this };
    13181325                        maybe_accept( node, &OffsetofExpr::result );
    13191326                }
    13201327                maybe_accept( node, &OffsetofExpr::type   );
    1321         )
     1328        }
    13221329
    13231330        VISIT_END( Expr, node );
     
    13301337        VISIT_START( node );
    13311338
    1332         VISIT({
     1339        if ( __visit_children() ) {
     1340                {
    13331341                        guard_symtab guard { *this };
    13341342                        maybe_accept( node, &OffsetPackExpr::result );
    13351343                }
    13361344                maybe_accept( node, &OffsetPackExpr::type   );
    1337         )
     1345        }
    13381346
    13391347        VISIT_END( Expr, node );
     
    13461354        VISIT_START( node );
    13471355
    1348         VISIT({
     1356        if ( __visit_children() ) {
     1357                {
    13491358                        guard_symtab guard { *this };
    13501359                        maybe_accept( node, &LogicalExpr::result );
     
    13521361                maybe_accept( node, &LogicalExpr::arg1 );
    13531362                maybe_accept( node, &LogicalExpr::arg2 );
    1354         )
     1363        }
    13551364
    13561365        VISIT_END( Expr, node );
     
    13631372        VISIT_START( node );
    13641373
    1365         VISIT({
     1374        if ( __visit_children() ) {
     1375                {
    13661376                        guard_symtab guard { *this };
    13671377                        maybe_accept( node, &ConditionalExpr::result );
     
    13701380                maybe_accept( node, &ConditionalExpr::arg2 );
    13711381                maybe_accept( node, &ConditionalExpr::arg3 );
    1372         )
     1382        }
    13731383
    13741384        VISIT_END( Expr, node );
     
    13811391        VISIT_START( node );
    13821392
    1383         VISIT({
     1393        if ( __visit_children() ) {
     1394                {
    13841395                        guard_symtab guard { *this };
    13851396                        maybe_accept( node, &CommaExpr::result );
     
    13871398                maybe_accept( node, &CommaExpr::arg1 );
    13881399                maybe_accept( node, &CommaExpr::arg2 );
    1389         )
     1400        }
    13901401
    13911402        VISIT_END( Expr, node );
     
    13981409        VISIT_START( node );
    13991410
    1400         VISIT({
     1411        if ( __visit_children() ) {
     1412                {
    14011413                        guard_symtab guard { *this };
    14021414                        maybe_accept( node, &TypeExpr::result );
    14031415                }
    14041416                maybe_accept( node, &TypeExpr::type );
    1405         )
     1417        }
    14061418
    14071419        VISIT_END( Expr, node );
     
    14141426        VISIT_START( node );
    14151427
    1416         VISIT({
     1428        if ( __visit_children() ) {
     1429                {
    14171430                        guard_symtab guard { *this };
    14181431                        maybe_accept( node, &AsmExpr::result );
     
    14201433                maybe_accept( node, &AsmExpr::constraint );
    14211434                maybe_accept( node, &AsmExpr::operand    );
    1422         )
     1435        }
    14231436
    14241437        VISIT_END( Expr, node );
     
    14311444        VISIT_START( node );
    14321445
    1433         VISIT({
     1446        if ( __visit_children() ) {
     1447                {
    14341448                        guard_symtab guard { *this };
    14351449                        maybe_accept( node, &ImplicitCopyCtorExpr::result );
    14361450                }
    14371451                maybe_accept( node, &ImplicitCopyCtorExpr::callExpr    );
    1438         )
     1452        }
    14391453
    14401454        VISIT_END( Expr, node );
     
    14471461        VISIT_START( node );
    14481462
    1449         VISIT({
     1463        if ( __visit_children() ) {
     1464                {
    14501465                        guard_symtab guard { *this };
    14511466                        maybe_accept( node, &ConstructorExpr::result );
    14521467                }
    14531468                maybe_accept( node, &ConstructorExpr::callExpr );
    1454         )
     1469        }
    14551470
    14561471        VISIT_END( Expr, node );
     
    14631478        VISIT_START( node );
    14641479
    1465         VISIT({
     1480        if ( __visit_children() ) {
     1481                {
    14661482                        guard_symtab guard { *this };
    14671483                        maybe_accept( node, &CompoundLiteralExpr::result );
    14681484                }
    14691485                maybe_accept( node, &CompoundLiteralExpr::init );
    1470         )
     1486        }
    14711487
    14721488        VISIT_END( Expr, node );
     
    14791495        VISIT_START( node );
    14801496
    1481         VISIT({
     1497        if ( __visit_children() ) {
     1498                {
    14821499                        guard_symtab guard { *this };
    14831500                        maybe_accept( node, &RangeExpr::result );
     
    14851502                maybe_accept( node, &RangeExpr::low    );
    14861503                maybe_accept( node, &RangeExpr::high   );
    1487         )
     1504        }
    14881505
    14891506        VISIT_END( Expr, node );
     
    14961513        VISIT_START( node );
    14971514
    1498         VISIT({
     1515        if ( __visit_children() ) {
     1516                {
    14991517                        guard_symtab guard { *this };
    15001518                        maybe_accept( node, &UntypedTupleExpr::result );
    15011519                }
    15021520                maybe_accept( node, &UntypedTupleExpr::exprs  );
    1503         )
     1521        }
    15041522
    15051523        VISIT_END( Expr, node );
     
    15121530        VISIT_START( node );
    15131531
    1514         VISIT({
     1532        if ( __visit_children() ) {
     1533                {
    15151534                        guard_symtab guard { *this };
    15161535                        maybe_accept( node, &TupleExpr::result );
    15171536                }
    15181537                maybe_accept( node, &TupleExpr::exprs  );
    1519         )
     1538        }
    15201539
    15211540        VISIT_END( Expr, node );
     
    15281547        VISIT_START( node );
    15291548
    1530         VISIT({
     1549        if ( __visit_children() ) {
     1550                {
    15311551                        guard_symtab guard { *this };
    15321552                        maybe_accept( node, &TupleIndexExpr::result );
    15331553                }
    15341554                maybe_accept( node, &TupleIndexExpr::tuple  );
    1535         )
     1555        }
    15361556
    15371557        VISIT_END( Expr, node );
     
    15441564        VISIT_START( node );
    15451565
    1546         VISIT({
     1566        if ( __visit_children() ) {
     1567                {
    15471568                        guard_symtab guard { *this };
    15481569                        maybe_accept( node, &TupleAssignExpr::result );
    15491570                }
    15501571                maybe_accept( node, &TupleAssignExpr::stmtExpr );
    1551         )
     1572        }
    15521573
    15531574        VISIT_END( Expr, node );
     
    15601581        VISIT_START( node );
    15611582
    1562         VISIT(// don't want statements from outer CompoundStmts to be added to this StmtExpr
     1583        if ( __visit_children() ) {
     1584                // don't want statements from outer CompoundStmts to be added to this StmtExpr
    15631585                // get the stmts that will need to be spliced in
    15641586                auto stmts_before = __pass::stmtsToAddBefore( core, 0);
     
    15771599                maybe_accept( node, &StmtExpr::returnDecls );
    15781600                maybe_accept( node, &StmtExpr::dtors       );
    1579         )
     1601        }
    15801602
    15811603        VISIT_END( Expr, node );
     
    15881610        VISIT_START( node );
    15891611
    1590         VISIT({
     1612        if ( __visit_children() ) {
     1613                {
    15911614                        guard_symtab guard { *this };
    15921615                        maybe_accept( node, &UniqueExpr::result );
    15931616                }
    15941617                maybe_accept( node, &UniqueExpr::expr   );
    1595         )
     1618        }
    15961619
    15971620        VISIT_END( Expr, node );
     
    16041627        VISIT_START( node );
    16051628
    1606         VISIT({
     1629        if ( __visit_children() ) {
     1630                {
    16071631                        guard_symtab guard { *this };
    16081632                        maybe_accept( node, &UntypedInitExpr::result );
     
    16101634                maybe_accept( node, &UntypedInitExpr::expr   );
    16111635                // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver.
    1612         )
     1636        }
    16131637
    16141638        VISIT_END( Expr, node );
     
    16211645        VISIT_START( node );
    16221646
    1623         VISIT({
     1647        if ( __visit_children() ) {
     1648                {
    16241649                        guard_symtab guard { *this };
    16251650                        maybe_accept( node, &InitExpr::result );
     
    16271652                maybe_accept( node, &InitExpr::expr   );
    16281653                maybe_accept( node, &InitExpr::designation );
    1629         )
     1654        }
    16301655
    16311656        VISIT_END( Expr, node );
     
    16381663        VISIT_START( node );
    16391664
    1640         VISIT({
     1665        if ( __visit_children() ) {
     1666                {
    16411667                        guard_symtab guard { *this };
    16421668                        maybe_accept( node, &DeletedExpr::result );
     
    16441670                maybe_accept( node, &DeletedExpr::expr );
    16451671                // don't visit deleteStmt, because it is a pointer to somewhere else in the tree.
    1646         )
     1672        }
    16471673
    16481674        VISIT_END( Expr, node );
     
    16551681        VISIT_START( node );
    16561682
    1657         VISIT({
     1683        if ( __visit_children() ) {
     1684                {
    16581685                        guard_symtab guard { *this };
    16591686                        maybe_accept( node, &DefaultArgExpr::result );
    16601687                }
    16611688                maybe_accept( node, &DefaultArgExpr::expr );
    1662         )
     1689        }
    16631690
    16641691        VISIT_END( Expr, node );
     
    16711698        VISIT_START( node );
    16721699
    1673         VISIT({
     1700        if ( __visit_children() ) {
     1701                {
    16741702                        guard_symtab guard { *this };
    16751703                        maybe_accept( node, &GenericExpr::result );
     
    17001728                        node = n;
    17011729                }
    1702         )
     1730        }
    17031731
    17041732        VISIT_END( Expr, node );
     
    17291757        VISIT_START( node );
    17301758
    1731         VISIT(
     1759        if ( __visit_children() ) {
    17321760                // xxx - should PointerType visit/mutate dimension?
    17331761                maybe_accept( node, &PointerType::base );
    1734         )
     1762        }
    17351763
    17361764        VISIT_END( Type, node );
     
    17431771        VISIT_START( node );
    17441772
    1745         VISIT(
     1773        if ( __visit_children() ) {
    17461774                maybe_accept( node, &ArrayType::dimension );
    17471775                maybe_accept( node, &ArrayType::base );
    1748         )
     1776        }
    17491777
    17501778        VISIT_END( Type, node );
     
    17571785        VISIT_START( node );
    17581786
    1759         VISIT(
     1787        if ( __visit_children() ) {
    17601788                maybe_accept( node, &ReferenceType::base );
    1761         )
     1789        }
    17621790
    17631791        VISIT_END( Type, node );
     
    17701798        VISIT_START( node );
    17711799
    1772         VISIT(
     1800        if ( __visit_children() ) {
    17731801                maybe_accept( node, &QualifiedType::parent );
    17741802                maybe_accept( node, &QualifiedType::child );
    1775         )
     1803        }
    17761804
    17771805        VISIT_END( Type, node );
     
    17841812        VISIT_START( node );
    17851813
    1786         VISIT({
     1814        if ( __visit_children() ) {
    17871815                // guard_forall_subs forall_guard { *this, node };
    17881816                // mutate_forall( node );
     
    17901818                maybe_accept( node, &FunctionType::returns );
    17911819                maybe_accept( node, &FunctionType::params  );
    1792         })
     1820        }
    17931821
    17941822        VISIT_END( Type, node );
     
    18031831        __pass::symtab::addStruct( core, 0, node->name );
    18041832
    1805         VISIT({
     1833        if ( __visit_children() ) {
    18061834                guard_symtab guard { *this };
    18071835                maybe_accept( node, &StructInstType::params );
    1808         })
     1836        }
    18091837
    18101838        VISIT_END( Type, node );
     
    18191847        __pass::symtab::addUnion( core, 0, node->name );
    18201848
    1821         VISIT({
     1849        if ( __visit_children() ) {
    18221850                guard_symtab guard { *this };
    18231851                maybe_accept( node, &UnionInstType::params );
    1824         })
     1852        }
    18251853
    18261854        VISIT_END( Type, node );
     
    18331861        VISIT_START( node );
    18341862
    1835         VISIT({
     1863        if ( __visit_children() ) {
    18361864                maybe_accept( node, &EnumInstType::params );
    1837         })
     1865        }
    18381866
    18391867        VISIT_END( Type, node );
     
    18461874        VISIT_START( node );
    18471875
    1848         VISIT({
     1876        if ( __visit_children() ) {
    18491877                maybe_accept( node, &TraitInstType::params );
    1850         })
     1878        }
    18511879
    18521880        VISIT_END( Type, node );
     
    18591887        VISIT_START( node );
    18601888
    1861         VISIT(
     1889        if ( __visit_children() ) {
    18621890                {
    18631891                        maybe_accept( node, &TypeInstType::params );
     
    18651893                // ensure that base re-bound if doing substitution
    18661894                __pass::forall::replace( core, 0, node );
    1867         )
     1895        }
    18681896
    18691897        VISIT_END( Type, node );
     
    18761904        VISIT_START( node );
    18771905
    1878         VISIT(
     1906        if ( __visit_children() ) {
    18791907                maybe_accept( node, &TupleType::types );
    18801908                maybe_accept( node, &TupleType::members );
    1881         )
     1909        }
    18821910
    18831911        VISIT_END( Type, node );
     
    18901918        VISIT_START( node );
    18911919
    1892         VISIT(
     1920        if ( __visit_children() ) {
    18931921                maybe_accept( node, &TypeofType::expr );
    1894         )
     1922        }
    18951923
    18961924        VISIT_END( Type, node );
     
    19031931        VISIT_START( node );
    19041932
    1905         VISIT(
     1933        if ( __visit_children() ) {
    19061934                maybe_accept( node, &VTableType::base );
    1907         )
     1935        }
    19081936
    19091937        VISIT_END( Type, node );
     
    19531981        VISIT_START( node );
    19541982
    1955         VISIT( maybe_accept( node, &Designation::designators ); )
     1983        if ( __visit_children() ) {
     1984                maybe_accept( node, &Designation::designators );
     1985        }
    19561986
    19571987        VISIT_END( Designation, node );
     
    19641994        VISIT_START( node );
    19651995
    1966         VISIT(
     1996        if ( __visit_children() ) {
    19671997                maybe_accept( node, &SingleInit::value );
    1968         )
     1998        }
    19691999
    19702000        VISIT_END( Init, node );
     
    19772007        VISIT_START( node );
    19782008
    1979         VISIT(
     2009        if ( __visit_children() ) {
    19802010                maybe_accept( node, &ListInit::designations );
    19812011                maybe_accept( node, &ListInit::initializers );
    1982         )
     2012        }
    19832013
    19842014        VISIT_END( Init, node );
     
    19912021        VISIT_START( node );
    19922022
    1993         VISIT(
     2023        if ( __visit_children() ) {
    19942024                maybe_accept( node, &ConstructorInit::ctor );
    19952025                maybe_accept( node, &ConstructorInit::dtor );
    19962026                maybe_accept( node, &ConstructorInit::init );
    1997         )
     2027        }
    19982028
    19992029        VISIT_END( Init, node );
     
    20062036        VISIT_START( node );
    20072037
    2008         VISIT(
     2038        if ( __visit_children() ) {
    20092039                maybe_accept( node, &Attribute::params );
    2010         )
     2040        }
    20112041
    20122042        VISIT_END( Attribute, node );
     
    20192049        VISIT_START( node );
    20202050
    2021         VISIT(
     2051        if ( __visit_children() ) {
    20222052                {
    20232053                        bool mutated = false;
     
    20352065                        }
    20362066                }
    2037         )
     2067        }
    20382068
    20392069        VISIT_END( TypeSubstitution, node );
     
    20412071
    20422072#undef VISIT_START
    2043 #undef VISIT
    20442073#undef VISIT_END
Note: See TracChangeset for help on using the changeset viewer.