Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.impl.h

    rc194661 rd8893ca  
    5555                it,
    5656                [](Declaration * decl) -> auto {
    57                         return new DeclStmt( decl );
     57                        return new DeclStmt( noLabels, decl );
    5858                }
    5959        );
     
    6262
    6363template< typename pass_type >
    64 inline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) {
     64static inline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) {
    6565        DeclList_t* beforeDecls = visitor.get_beforeDecls();
    6666        DeclList_t* afterDecls  = visitor.get_afterDecls();
    67         SemanticErrorException errors;
     67        SemanticError errors;
    6868
    6969        for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
     
    7676                        // run visitor on declaration
    7777                        maybeAccept_impl( *i, visitor );
    78                 } catch( SemanticErrorException &e ) {
     78                } catch( SemanticError &e ) {
     79                        e.set_location( (*i)->location );
    7980                        errors.append( e );
    8081                }
     
    8990
    9091template< typename pass_type >
    91 inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) {
     92static inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) {
    9293        DeclList_t* beforeDecls = mutator.get_beforeDecls();
    9394        DeclList_t* afterDecls  = mutator.get_afterDecls();
    94         SemanticErrorException errors;
     95        SemanticError errors;
    9596
    9697        for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
     
    102103                        // run mutator on declaration
    103104                        maybeMutate_impl( *i, mutator );
    104                 } catch( SemanticErrorException &e ) {
     105                } catch( SemanticError &e ) {
     106                        e.set_location( (*i)->location );
    105107                        errors.append( e );
    106108                }
     
    125127inline void maybeAccept_impl( Container & container, PassVisitor< pass_type > & visitor ) {
    126128        if ( ! visitor.get_visit_children() ) return;
    127         SemanticErrorException errors;
     129        SemanticError errors;
    128130        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
    129131                try {
     
    131133                                (*i)->accept( visitor );
    132134                        }
    133                 } catch( SemanticErrorException &e ) {
     135                } catch( SemanticError &e ) {
     136                        e.set_location( (*i)->location );
    134137                        errors.append( e );
    135138                }
     
    152155inline void maybeMutate_impl( Container & container, PassVisitor< pass_type > & mutator ) {
    153156        if ( ! mutator.get_visit_children() ) return;
    154         SemanticErrorException errors;
     157        SemanticError errors;
    155158        for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
    156159                try {
     
    159162                                assert( *i );
    160163                        } // if
    161                 } catch( SemanticErrorException &e ) {
     164                } catch( SemanticError &e ) {
     165                        e.set_location( (*i)->location );
    162166                        errors.append( e );
    163167                } // try
     
    172176void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) {
    173177        if ( ! get_visit_children() ) return;
    174         SemanticErrorException errors;
     178        SemanticError errors;
    175179
    176180        // don't want statements from outer CompoundStmts to be added to this CompoundStmt
     
    195199                            || ( empty( beforeDecls ) && empty( afterDecls )) );
    196200
    197                 } catch ( SemanticErrorException &e ) {
     201                } catch ( SemanticError &e ) {
     202                        e.set_location( (*i)->location );
    198203                        errors.append( e );
    199204                }
     
    246251            || ( empty( beforeDecls ) && empty( afterDecls )) );
    247252
    248         CompoundStmt *compound = new CompoundStmt();
     253        CompoundStmt *compound = new CompoundStmt( noLabels );
    249254        if( !empty(beforeDecls) ) { splice( std::back_inserter( compound->get_kids() ), beforeDecls ); }
    250255        if( !empty(beforeStmts) ) { compound->get_kids().splice( compound->get_kids().end(), *beforeStmts ); }
     
    360365        maybeAccept_impl   ( node->attributes   , *this );
    361366
    362         indexerAddId( node );
     367        if ( node->name != "" ) {
     368                indexerAddId( node );
     369        }
    363370
    364371        VISIT_END( node );
     
    374381        maybeMutate_impl   ( node->attributes   , *this );
    375382
    376         indexerAddId( node );
     383        if ( node->name != "" ) {
     384                indexerAddId( node );
     385        }
    377386
    378387        MUTATE_END( DeclarationWithType, node );
     
    385394        VISIT_START( node );
    386395
    387         indexerAddId( node );
    388 
    389         maybeAccept_impl( node->withExprs, *this );
    390         {
    391                 // with clause introduces a level of scope (for the with expression members).
    392                 // with clause exprs are added to the indexer before parameters so that parameters
    393                 // shadow with exprs and not the other way around.
    394                 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    395                 indexerAddWith( node->withExprs, node );
    396                 {
    397                         auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    398                         // implicit add __func__ identifier as specified in the C manual 6.4.2.2
    399                         static ObjectDecl func(
    400                                 "__func__", noStorageClasses, LinkageSpec::C, nullptr,
    401                                 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
    402                                 nullptr
    403                         );
    404                         indexerAddId( &func );
    405                         maybeAccept_impl( node->type, *this );
    406                         // function body needs to have the same scope as parameters - CompoundStmt will not enter
    407                         // a new scope if inFunction is true
    408                         ValueGuard< bool > oldInFunction( inFunction );
    409                         inFunction = true;
    410                         maybeAccept_impl( node->statements, *this );
    411                         maybeAccept_impl( node->attributes, *this );
    412                 }
     396        if ( node->name != "" ) {
     397                indexerAddId( node );
     398        }
     399
     400        {
     401                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     402                // implicit add __func__ identifier as specified in the C manual 6.4.2.2
     403                static ObjectDecl func(
     404                        "__func__", noStorageClasses, LinkageSpec::C, nullptr,
     405                        new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
     406                        nullptr
     407                );
     408                indexerAddId( &func );
     409                maybeAccept_impl( node->type, *this );
     410                maybeAccept_impl( node->statements, *this );
     411                maybeAccept_impl( node->attributes, *this );
    413412        }
    414413
     
    420419        MUTATE_START( node );
    421420
    422         indexerAddId( node );
    423 
    424         {
    425                 // with clause introduces a level of scope (for the with expression members).
    426                 // with clause exprs are added to the indexer before parameters so that parameters
    427                 // shadow with exprs and not the other way around.
    428                 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    429                 indexerAddWith( node->withExprs, node );
    430                 {
    431                         auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    432                         // implicit add __func__ identifier as specified in the C manual 6.4.2.2
    433                         static ObjectDecl func(
    434                                 "__func__", noStorageClasses, LinkageSpec::C, nullptr,
    435                                 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
    436                                 nullptr
    437                         );
    438                         indexerAddId( &func );
    439                         maybeMutate_impl( node->type, *this );
    440                         // function body needs to have the same scope as parameters - CompoundStmt will not enter
    441                         // a new scope if inFunction is true
    442                         ValueGuard< bool > oldInFunction( inFunction );
    443                         inFunction = true;
    444                         maybeMutate_impl( node->statements, *this );
    445                         maybeMutate_impl( node->attributes, *this );
    446                 }
     421        if ( node->name != "" ) {
     422                indexerAddId( node );
     423        }
     424
     425        {
     426                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     427                // implicit add __func__ identifier as specified in the C manual 6.4.2.2
     428                static ObjectDecl func(
     429                        "__func__", noStorageClasses, LinkageSpec::C, nullptr,
     430                        new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
     431                        nullptr
     432                );
     433                indexerAddId( &func );
     434                maybeMutate_impl( node->type, *this );
     435                maybeMutate_impl( node->statements, *this );
     436                maybeMutate_impl( node->attributes, *this );
    447437        }
    448438
     
    693683
    694684//--------------------------------------------------------------------------
    695 // StaticAssertDecl
    696 template< typename pass_type >
    697 void PassVisitor< pass_type >::visit( StaticAssertDecl * node ) {
    698         VISIT_START( node );
    699 
    700         node->condition = visitExpression( node->condition );
    701         maybeAccept_impl( node->message, *this );
    702 
    703         VISIT_END( node );
    704 }
    705 
    706 template< typename pass_type >
    707 StaticAssertDecl * PassVisitor< pass_type >::mutate( StaticAssertDecl * node ) {
    708         MUTATE_START( node );
    709 
    710         node->condition = mutateExpression( node->condition );
    711         maybeMutate_impl( node->message, *this );
    712 
    713         MUTATE_END( StaticAssertDecl, node );
    714 }
    715 
    716 //--------------------------------------------------------------------------
    717685// CompoundStmt
    718686template< typename pass_type >
     
    720688        VISIT_START( node );
    721689        {
    722                 // do not enter a new scope if inFunction is true - needs to check old state before the assignment
    723                 ValueGuard< bool > oldInFunction( inFunction );
    724                 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } );
     690                auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    725691                auto guard2 = makeFuncGuard( [this]() { call_beginScope();   }, [this]() { call_endScope();     } );
    726                 inFunction = false;
    727692                visitStatementList( node->kids );
    728693        }
     
    734699        MUTATE_START( node );
    735700        {
    736                 // do not enter a new scope if inFunction is true - needs to check old state before the assignment
    737                 ValueGuard< bool > oldInFunction( inFunction );
    738                 auto guard1 = makeFuncGuard( [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeEnter(); }, [this, &oldInFunction]() { if ( ! oldInFunction.old ) indexerScopeLeave(); } );
     701                auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    739702                auto guard2 = makeFuncGuard( [this]() { call_beginScope();   }, [this]() { call_endScope();     } );
    740                 inFunction = false;
    741703                mutateStatementList( node->kids );
    742704        }
     
    768730template< typename pass_type >
    769731void PassVisitor< pass_type >::visit( AsmStmt * node ) {
    770         VISIT_START( node )
    771 
    772         maybeAccept_impl( node->instruction, *this );
    773         maybeAccept_impl( node->output, *this );
    774         maybeAccept_impl( node->input, *this );
    775         maybeAccept_impl( node->clobber, *this );
    776 
    777         VISIT_END( node );
     732        VISIT_BODY( node );
    778733}
    779734
    780735template< typename pass_type >
    781736Statement * PassVisitor< pass_type >::mutate( AsmStmt * node ) {
    782         MUTATE_START( node );
    783 
    784         maybeMutate_impl( node->instruction, *this );
    785         maybeMutate_impl( node->output, *this );
    786         maybeMutate_impl( node->input, *this );
    787         maybeMutate_impl( node->clobber, *this );
    788 
    789         MUTATE_END( Statement, node );
    790 }
    791 
    792 //--------------------------------------------------------------------------
    793 // AsmStmt
    794 template< typename pass_type >
    795 void PassVisitor< pass_type >::visit( DirectiveStmt * node ) {
    796         VISIT_START( node )
    797 
    798         VISIT_END( node );
    799 }
    800 
    801 template< typename pass_type >
    802 Statement * PassVisitor< pass_type >::mutate( DirectiveStmt * node ) {
    803         MUTATE_START( node );
    804 
    805         MUTATE_END( Statement, node );
     737        MUTATE_BODY( Statement, node );
    806738}
    807739
     
    842774        VISIT_START( node );
    843775
    844         {
    845                 // while statements introduce a level of scope (for the initialization)
    846                 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    847                 maybeAccept_impl( node->initialization, *this );
    848                 visitExpression ( node->condition );
    849                 node->body = visitStatement( node->body );
    850         }
     776        visitExpression( node->condition );
     777        node->body = visitStatement( node->body );
    851778
    852779        VISIT_END( node );
     
    857784        MUTATE_START( node );
    858785
    859         {
    860                 // while statements introduce a level of scope (for the initialization)
    861                 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    862                 maybeMutate_impl( node->initialization, *this );
    863                 node->condition = mutateExpression( node->condition );
    864                 node->body      = mutateStatement ( node->body      );
    865         }
    866 
     786        node->condition = mutateExpression( node->condition );
     787        node->body      = mutateStatement ( node->body      );
    867788
    868789        MUTATE_END( Statement, node );
     
    947868template< typename pass_type >
    948869void PassVisitor< pass_type >::visit( BranchStmt * node ) {
    949         VISIT_START( node );
    950         VISIT_END( node );
     870        VISIT_BODY( node );
    951871}
    952872
    953873template< typename pass_type >
    954874Statement * PassVisitor< pass_type >::mutate( BranchStmt * node ) {
    955         MUTATE_START( node );
     875        MUTATE_BODY( Statement, node );
     876}
     877
     878//--------------------------------------------------------------------------
     879// ReturnStmt
     880template< typename pass_type >
     881void PassVisitor< pass_type >::visit( ReturnStmt * node ) {
     882        VISIT_START( node );
     883
     884        visitExpression( node->expr );
     885
     886        VISIT_END( node );
     887}
     888
     889template< typename pass_type >
     890Statement * PassVisitor< pass_type >::mutate( ReturnStmt * node ) {
     891        MUTATE_START( node );
     892
     893        node->expr = mutateExpression( node->expr );
     894
    956895        MUTATE_END( Statement, node );
    957896}
    958897
    959898//--------------------------------------------------------------------------
    960 // ReturnStmt
    961 template< typename pass_type >
    962 void PassVisitor< pass_type >::visit( ReturnStmt * node ) {
    963         VISIT_START( node );
    964 
    965         visitExpression( node->expr );
    966 
    967         VISIT_END( node );
    968 }
    969 
    970 template< typename pass_type >
    971 Statement * PassVisitor< pass_type >::mutate( ReturnStmt * node ) {
    972         MUTATE_START( node );
    973 
    974         node->expr = mutateExpression( node->expr );
    975 
    976         MUTATE_END( Statement, node );
    977 }
    978 
    979 //--------------------------------------------------------------------------
    980899// ThrowStmt
    981900
    982901template< typename pass_type >
    983902void PassVisitor< pass_type >::visit( ThrowStmt * node ) {
    984         VISIT_START( node );
    985 
    986         maybeAccept_impl( node->expr, *this );
    987         maybeAccept_impl( node->target, *this );
    988 
    989         VISIT_END( node );
     903        VISIT_BODY( node );
    990904}
    991905
    992906template< typename pass_type >
    993907Statement * PassVisitor< pass_type >::mutate( ThrowStmt * node ) {
    994         MUTATE_START( node );
    995 
    996         maybeMutate_impl( node->expr, *this );
    997         maybeMutate_impl( node->target, *this );
    998 
    999         MUTATE_END( Statement, node );
     908        MUTATE_BODY( Statement, node );
    1000909}
    1001910
     
    1056965template< typename pass_type >
    1057966void PassVisitor< pass_type >::visit( FinallyStmt * node ) {
    1058         VISIT_START( node );
    1059 
    1060         maybeAccept_impl( node->block, *this );
    1061 
    1062         VISIT_END( node );
     967        VISIT_BODY( node );
    1063968}
    1064969
    1065970template< typename pass_type >
    1066971Statement * PassVisitor< pass_type >::mutate( FinallyStmt * node ) {
    1067         MUTATE_START( node );
    1068 
    1069         maybeMutate_impl( node->block, *this );
    1070 
     972        MUTATE_BODY( Statement, node );
     973}
     974
     975//--------------------------------------------------------------------------
     976// WaitForStmt
     977template< typename pass_type >
     978void PassVisitor< pass_type >::visit( WaitForStmt * node ) {
     979        VISIT_BODY( node );
     980}
     981
     982template< typename pass_type >
     983Statement * PassVisitor< pass_type >::mutate( WaitForStmt * node ) {
     984        MUTATE_BODY( Statement, node );
     985}
     986
     987
     988
     989//--------------------------------------------------------------------------
     990// NullStmt
     991template< typename pass_type >
     992void PassVisitor< pass_type >::visit( WithStmt * node ) {
     993        VISIT_START( node );
     994        maybeAccept_impl( node->exprs, *this );
     995        {
     996                // catch statements introduce a level of scope (for the caught exception)
     997                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     998                indexerAddWith( node );
     999                maybeAccept_impl( node->stmt, *this );
     1000        }
     1001        VISIT_END( node );
     1002}
     1003
     1004template< typename pass_type >
     1005Statement * PassVisitor< pass_type >::mutate( WithStmt * node ) {
     1006        MUTATE_START( node );
     1007        maybeMutate_impl( node->exprs, *this );
     1008        {
     1009                // catch statements introduce a level of scope (for the caught exception)
     1010                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     1011                indexerAddWith( node );
     1012                maybeMutate_impl( node->stmt, *this );
     1013        }
    10711014        MUTATE_END( Statement, node );
    10721015}
    10731016
    10741017//--------------------------------------------------------------------------
    1075 // WaitForStmt
    1076 template< typename pass_type >
    1077 void PassVisitor< pass_type >::visit( WaitForStmt * node ) {
    1078         VISIT_START( node );
    1079 
    1080         for( auto & clause : node->clauses ) {
    1081                 maybeAccept_impl( clause.target.function, *this );
    1082                 maybeAccept_impl( clause.target.arguments, *this );
    1083 
    1084                 maybeAccept_impl( clause.statement, *this );
    1085                 maybeAccept_impl( clause.condition, *this );
    1086         }
    1087 
    1088         maybeAccept_impl( node->timeout.time, *this );
    1089         maybeAccept_impl( node->timeout.statement, *this );
    1090         maybeAccept_impl( node->timeout.condition, *this );
    1091         maybeAccept_impl( node->orelse.statement, *this );
    1092         maybeAccept_impl( node->orelse.condition, *this );
    1093 
    1094         VISIT_END( node );
    1095 }
    1096 
    1097 template< typename pass_type >
    1098 Statement * PassVisitor< pass_type >::mutate( WaitForStmt * node ) {
    1099         MUTATE_START( node );
    1100 
    1101         for( auto & clause : node->clauses ) {
    1102                 maybeMutate_impl( clause.target.function, *this );
    1103                 maybeMutate_impl( clause.target.arguments, *this );
    1104 
    1105                 maybeMutate_impl( clause.statement, *this );
    1106                 maybeMutate_impl( clause.condition, *this );
    1107         }
    1108 
    1109         maybeMutate_impl( node->timeout.time, *this );
    1110         maybeMutate_impl( node->timeout.statement, *this );
    1111         maybeMutate_impl( node->timeout.condition, *this );
    1112         maybeMutate_impl( node->orelse.statement, *this );
    1113         maybeMutate_impl( node->orelse.condition, *this );
    1114 
    1115         MUTATE_END( Statement, node );
    1116 }
    1117 
    1118 
    1119 
    1120 //--------------------------------------------------------------------------
    11211018// NullStmt
    11221019template< typename pass_type >
    1123 void PassVisitor< pass_type >::visit( WithStmt * node ) {
    1124         VISIT_START( node );
    1125         maybeAccept_impl( node->exprs, *this );
    1126         {
    1127                 // catch statements introduce a level of scope (for the caught exception)
    1128                 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1129                 indexerAddWith( node->exprs, node );
    1130                 maybeAccept_impl( node->stmt, *this );
    1131         }
    1132         VISIT_END( node );
    1133 }
    1134 
    1135 template< typename pass_type >
    1136 Statement * PassVisitor< pass_type >::mutate( WithStmt * node ) {
    1137         MUTATE_START( node );
    1138         maybeMutate_impl( node->exprs, *this );
    1139         {
    1140                 // catch statements introduce a level of scope (for the caught exception)
    1141                 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1142                 indexerAddWith( node->exprs, node );
    1143                 maybeMutate_impl( node->stmt, *this );
    1144         }
    1145         MUTATE_END( Statement, node );
    1146 }
    1147 
    1148 //--------------------------------------------------------------------------
    1149 // NullStmt
    1150 template< typename pass_type >
    11511020void PassVisitor< pass_type >::visit( NullStmt * node ) {
    1152         VISIT_START( node );
    1153         VISIT_END( node );
     1021        VISIT_BODY( node );
    11541022}
    11551023
    11561024template< typename pass_type >
    11571025NullStmt * PassVisitor< pass_type >::mutate( NullStmt * node ) {
    1158         MUTATE_START( node );
    1159         MUTATE_END( NullStmt, node );
     1026        MUTATE_BODY( NullStmt, node );
    11601027}
    11611028
     
    11641031template< typename pass_type >
    11651032void PassVisitor< pass_type >::visit( DeclStmt * node ) {
    1166         VISIT_START( node );
    1167 
    1168         maybeAccept_impl( node->decl, *this );
    1169 
    1170         VISIT_END( node );
     1033        VISIT_BODY( node );
    11711034}
    11721035
    11731036template< typename pass_type >
    11741037Statement * PassVisitor< pass_type >::mutate( DeclStmt * node ) {
    1175         MUTATE_START( node );
    1176 
    1177         maybeMutate_impl( node->decl, *this );
    1178 
    1179         MUTATE_END( Statement, node );
     1038        MUTATE_BODY( Statement, node );
    11801039}
    11811040
     
    11841043template< typename pass_type >
    11851044void PassVisitor< pass_type >::visit( ImplicitCtorDtorStmt * node ) {
    1186         VISIT_START( node );
    1187 
    1188         maybeAccept_impl( node->callStmt, *this );
    1189 
    1190         VISIT_END( node );
     1045        VISIT_BODY( node );
    11911046}
    11921047
    11931048template< typename pass_type >
    11941049Statement * PassVisitor< pass_type >::mutate( ImplicitCtorDtorStmt * node ) {
    1195         MUTATE_START( node );
    1196 
    1197         maybeMutate_impl( node->callStmt, *this );
    1198 
    1199         MUTATE_END( Statement, node );
     1050        MUTATE_BODY( Statement, node );
    12001051}
    12011052
     
    12901141template< typename pass_type >
    12911142Expression * PassVisitor< pass_type >::mutate( CastExpr * node ) {
    1292         MUTATE_START( node );
    1293 
    1294         indexerScopedMutate( node->env   , *this );
    1295         indexerScopedMutate( node->result, *this );
    1296         maybeMutate_impl   ( node->arg   , *this );
    1297 
    1298         MUTATE_END( Expression, node );
    1299 }
    1300 
    1301 //--------------------------------------------------------------------------
    1302 // KeywordCastExpr
    1303 template< typename pass_type >
    1304 void PassVisitor< pass_type >::visit( KeywordCastExpr * node ) {
    1305         VISIT_START( node );
    1306 
    1307         indexerScopedAccept( node->result, *this );
    1308         maybeAccept_impl        ( node->arg   , *this );
    1309 
    1310         VISIT_END( node );
    1311 }
    1312 
    1313 template< typename pass_type >
    1314 Expression * PassVisitor< pass_type >::mutate( KeywordCastExpr * node ) {
    13151143        MUTATE_START( node );
    13161144
     
    15761404        indexerScopedAccept( node->result, *this );
    15771405        maybeAccept_impl   ( node->type  , *this );
     1406        maybeAccept_impl   ( node->member, *this );
    15781407
    15791408        VISIT_END( node );
     
    15871416        indexerScopedMutate( node->result, *this );
    15881417        maybeMutate_impl   ( node->type  , *this );
     1418        maybeMutate_impl   ( node->member, *this );
    15891419
    15901420        MUTATE_END( Expression, node );
     
    20231853}
    20241854
    2025 //--------------------------------------------------------------------------
    2026 // UntypedInitExpr
    2027 template< typename pass_type >
    2028 void PassVisitor< pass_type >::visit( UntypedInitExpr * node ) {
    2029         VISIT_START( node );
    2030 
    2031         indexerScopedAccept( node->result, *this );
    2032         maybeAccept_impl   ( node->expr  , *this );
    2033         // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver.
    2034 
    2035         VISIT_END( node );
    2036 }
    2037 
    2038 template< typename pass_type >
    2039 Expression * PassVisitor< pass_type >::mutate( UntypedInitExpr * node ) {
    2040         MUTATE_START( node );
    2041 
    2042         indexerScopedMutate( node->env   , *this );
    2043         indexerScopedMutate( node->result, *this );
    2044         maybeMutate_impl   ( node->expr  , *this );
    2045         // not currently visiting initAlts, but this doesn't matter since this node is only used in the resolver.
    2046 
    2047         MUTATE_END( Expression, node );
    2048 }
    2049 
    2050 //--------------------------------------------------------------------------
    2051 // InitExpr
    2052 template< typename pass_type >
    2053 void PassVisitor< pass_type >::visit( InitExpr * node ) {
    2054         VISIT_START( node );
    2055 
    2056         indexerScopedAccept( node->result, *this );
    2057         maybeAccept_impl   ( node->expr  , *this );
    2058         maybeAccept_impl   ( node->designation, *this );
    2059 
    2060         VISIT_END( node );
    2061 }
    2062 
    2063 template< typename pass_type >
    2064 Expression * PassVisitor< pass_type >::mutate( InitExpr * node ) {
    2065         MUTATE_START( node );
    2066 
    2067         indexerScopedMutate( node->env   , *this );
    2068         indexerScopedMutate( node->result, *this );
    2069         maybeMutate_impl   ( node->expr  , *this );
    2070         maybeMutate_impl   ( node->designation, *this );
    2071 
    2072         MUTATE_END( Expression, node );
    2073 }
    2074 
    2075 //--------------------------------------------------------------------------
    2076 // DeletedExpr
    2077 template< typename pass_type >
    2078 void PassVisitor< pass_type >::visit( DeletedExpr * node ) {
    2079         VISIT_START( node );
    2080 
    2081         indexerScopedAccept( node->result, *this );
    2082         maybeAccept_impl( node->expr, *this );
    2083         // don't visit deleteStmt, because it is a pointer to somewhere else in the tree.
    2084 
    2085         VISIT_END( node );
    2086 }
    2087 
    2088 template< typename pass_type >
    2089 Expression * PassVisitor< pass_type >::mutate( DeletedExpr * node ) {
    2090         MUTATE_START( node );
    2091 
    2092         indexerScopedMutate( node->env, *this );
    2093         indexerScopedMutate( node->result, *this );
    2094         maybeMutate_impl( node->expr, *this );
    2095 
    2096         MUTATE_END( Expression, node );
    2097 }
    2098 
    2099 //--------------------------------------------------------------------------
    2100 // DefaultArgExpr
    2101 template< typename pass_type >
    2102 void PassVisitor< pass_type >::visit( DefaultArgExpr * node ) {
    2103         VISIT_START( node );
    2104 
    2105         indexerScopedAccept( node->result, *this );
    2106         maybeAccept_impl( node->expr, *this );
    2107 
    2108         VISIT_END( node );
    2109 }
    2110 
    2111 template< typename pass_type >
    2112 Expression * PassVisitor< pass_type >::mutate( DefaultArgExpr * node ) {
    2113         MUTATE_START( node );
    2114 
    2115         indexerScopedMutate( node->env, *this );
    2116         indexerScopedMutate( node->result, *this );
    2117         maybeMutate_impl( node->expr, *this );
    2118 
    2119         MUTATE_END( Expression, node );
    2120 }
    2121 
    2122 //--------------------------------------------------------------------------
    2123 // GenericExpr
    2124 template< typename pass_type >
    2125 void PassVisitor< pass_type >::visit( GenericExpr * node ) {
    2126         VISIT_START( node );
    2127 
    2128         indexerScopedAccept( node->result, *this );
    2129         maybeAccept_impl( node->control, *this );
    2130         for ( GenericExpr::Association & assoc : node->associations ) {
    2131                 indexerScopedAccept( assoc.type, *this );
    2132                 maybeAccept_impl( assoc.expr, *this );
    2133         }
    2134 
    2135         VISIT_END( node );
    2136 }
    2137 
    2138 template< typename pass_type >
    2139 Expression * PassVisitor< pass_type >::mutate( GenericExpr * node ) {
    2140         MUTATE_START( node );
    2141 
    2142         indexerScopedMutate( node->env, *this );
    2143         indexerScopedMutate( node->result, *this );
    2144         maybeMutate_impl( node->control, *this );
    2145         for ( GenericExpr::Association & assoc : node->associations ) {
    2146                 indexerScopedMutate( assoc.type, *this );
    2147                 maybeMutate_impl( assoc.expr, *this );
    2148         }
    2149 
    2150         MUTATE_END( Expression, node );
    2151 }
    2152 
    2153 //--------------------------------------------------------------------------
    2154 // VoidType
    21551855template< typename pass_type >
    21561856void PassVisitor< pass_type >::visit( VoidType * node ) {
    2157         VISIT_START( node );
    2158 
    2159         maybeAccept_impl( node->forall, *this );
    2160 
    2161         VISIT_END( node );
    2162 }
    2163 
    2164 template< typename pass_type >
    2165 Type * PassVisitor< pass_type >::mutate( VoidType * node ) {
    2166         MUTATE_START( node );
    2167 
    2168         maybeMutate_impl( node->forall, *this );
    2169 
    2170         MUTATE_END( Type, node );
    2171 }
    2172 
    2173 //--------------------------------------------------------------------------
    2174 // BasicType
     1857        VISIT_BODY( node );
     1858}
     1859
    21751860template< typename pass_type >
    21761861void PassVisitor< pass_type >::visit( BasicType * node ) {
    2177         VISIT_START( node );
    2178 
    2179         maybeAccept_impl( node->forall, *this );
    2180 
    2181         VISIT_END( node );
    2182 }
    2183 
    2184 template< typename pass_type >
    2185 Type * PassVisitor< pass_type >::mutate( BasicType * node ) {
    2186         MUTATE_START( node );
    2187 
    2188         maybeMutate_impl( node->forall, *this );
    2189 
    2190         MUTATE_END( Type, node );
    2191 }
    2192 
    2193 //--------------------------------------------------------------------------
    2194 // PointerType
     1862        VISIT_BODY( node );
     1863}
     1864
    21951865template< typename pass_type >
    21961866void PassVisitor< pass_type >::visit( PointerType * node ) {
    2197         VISIT_START( node );
    2198 
    2199         maybeAccept_impl( node->forall, *this );
    2200         // xxx - should PointerType visit/mutate dimension?
    2201         maybeAccept_impl( node->base, *this );
    2202 
    2203         VISIT_END( node );
    2204 }
    2205 
    2206 template< typename pass_type >
    2207 Type * PassVisitor< pass_type >::mutate( PointerType * node ) {
    2208         MUTATE_START( node );
    2209 
    2210         maybeMutate_impl( node->forall, *this );
    2211         // xxx - should PointerType visit/mutate dimension?
    2212         maybeMutate_impl( node->base, *this );
    2213 
    2214         MUTATE_END( Type, node );
    2215 }
    2216 
    2217 //--------------------------------------------------------------------------
    2218 // ArrayType
     1867        VISIT_BODY( node );
     1868}
     1869
    22191870template< typename pass_type >
    22201871void PassVisitor< pass_type >::visit( ArrayType * node ) {
    2221         VISIT_START( node );
    2222 
    2223         maybeAccept_impl( node->forall, *this );
    2224         maybeAccept_impl( node->dimension, *this );
    2225         maybeAccept_impl( node->base, *this );
    2226 
    2227         VISIT_END( node );
    2228 }
    2229 
    2230 template< typename pass_type >
    2231 Type * PassVisitor< pass_type >::mutate( ArrayType * node ) {
    2232         MUTATE_START( node );
    2233 
    2234         maybeMutate_impl( node->forall, *this );
    2235         maybeMutate_impl( node->dimension, *this );
    2236         maybeMutate_impl( node->base, *this );
    2237 
    2238         MUTATE_END( Type, node );
    2239 }
    2240 
    2241 //--------------------------------------------------------------------------
    2242 // ReferenceType
     1872        VISIT_BODY( node );
     1873}
     1874
    22431875template< typename pass_type >
    22441876void PassVisitor< pass_type >::visit( ReferenceType * node ) {
    2245         VISIT_START( node );
    2246 
    2247         maybeAccept_impl( node->forall, *this );
    2248         maybeAccept_impl( node->base, *this );
    2249 
    2250         VISIT_END( node );
    2251 }
    2252 
    2253 template< typename pass_type >
    2254 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {
    2255         MUTATE_START( node );
    2256 
    2257         maybeMutate_impl( node->forall, *this );
    2258         maybeMutate_impl( node->base, *this );
    2259 
    2260         MUTATE_END( Type, node );
    2261 }
    2262 
    2263 //--------------------------------------------------------------------------
    2264 // QualifiedType
    2265 template< typename pass_type >
    2266 void PassVisitor< pass_type >::visit( QualifiedType * node ) {
    2267         VISIT_START( node );
    2268 
    2269         maybeAccept_impl( node->forall, *this );
    2270         maybeAccept_impl( node->parent, *this );
    2271         maybeAccept_impl( node->child, *this );
    2272 
    2273         VISIT_END( node );
    2274 }
    2275 
    2276 template< typename pass_type >
    2277 Type * PassVisitor< pass_type >::mutate( QualifiedType * node ) {
    2278         MUTATE_START( node );
    2279 
    2280         maybeMutate_impl( node->forall, *this );
    2281         maybeMutate_impl( node->parent, *this );
    2282         maybeMutate_impl( node->child, *this );
    2283 
    2284         MUTATE_END( Type, node );
    2285 }
    2286 
    2287 //--------------------------------------------------------------------------
    2288 // FunctionType
     1877        VISIT_BODY( node );
     1878}
     1879
    22891880template< typename pass_type >
    22901881void PassVisitor< pass_type >::visit( FunctionType * node ) {
    2291         VISIT_START( node );
    2292 
    2293         maybeAccept_impl( node->forall, *this );
    2294         maybeAccept_impl( node->returnVals, *this );
    2295         maybeAccept_impl( node->parameters, *this );
    2296 
    2297         VISIT_END( node );
    2298 }
    2299 
    2300 template< typename pass_type >
    2301 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) {
    2302         MUTATE_START( node );
    2303 
    2304         maybeMutate_impl( node->forall, *this );
    2305         maybeMutate_impl( node->returnVals, *this );
    2306         maybeMutate_impl( node->parameters, *this );
    2307 
    2308         MUTATE_END( Type, node );
     1882        VISIT_BODY( node );
    23091883}
    23101884
     
    23771951template< typename pass_type >
    23781952void PassVisitor< pass_type >::visit( EnumInstType * node ) {
    2379         VISIT_START( node );
    2380 
    2381         maybeAccept_impl( node->forall, *this );
    2382         maybeAccept_impl( node->parameters, *this );
    2383 
    2384         VISIT_END( node );
     1953        VISIT_BODY( node );
    23851954}
    23861955
    23871956template< typename pass_type >
    23881957Type * PassVisitor< pass_type >::mutate( EnumInstType * node ) {
    2389         MUTATE_START( node );
    2390 
    2391         maybeMutate_impl( node->forall, *this );
    2392         maybeMutate_impl( node->parameters, *this );
    2393 
    2394         MUTATE_END( Type, node );
     1958        MUTATE_BODY( Type, node );
    23951959}
    23961960
     
    24211985template< typename pass_type >
    24221986void PassVisitor< pass_type >::visit( TypeInstType * node ) {
    2423         VISIT_START( node );
    2424 
    2425         maybeAccept_impl( node->forall    , *this );
    2426         maybeAccept_impl( node->parameters, *this );
    2427 
    2428         VISIT_END( node );
     1987        VISIT_BODY( node );
     1988}
     1989
     1990template< typename pass_type >
     1991void PassVisitor< pass_type >::visit( TupleType * node ) {
     1992        VISIT_BODY( node );
     1993}
     1994
     1995template< typename pass_type >
     1996void PassVisitor< pass_type >::visit( TypeofType * node ) {
     1997        VISIT_BODY( node );
     1998}
     1999
     2000template< typename pass_type >
     2001void PassVisitor< pass_type >::visit( AttrType * node ) {
     2002        VISIT_BODY( node );
     2003}
     2004
     2005template< typename pass_type >
     2006void PassVisitor< pass_type >::visit( VarArgsType * node ) {
     2007        VISIT_BODY( node );
     2008}
     2009
     2010template< typename pass_type >
     2011void PassVisitor< pass_type >::visit( ZeroType * node ) {
     2012        VISIT_BODY( node );
     2013}
     2014
     2015template< typename pass_type >
     2016void PassVisitor< pass_type >::visit( OneType * node ) {
     2017        VISIT_BODY( node );
     2018}
     2019
     2020template< typename pass_type >
     2021void PassVisitor< pass_type >::visit( Designation * node ) {
     2022        VISIT_START( node );
     2023
     2024        maybeAccept_impl( node->get_designators(), *this );
     2025
     2026        VISIT_END( node );
     2027}
     2028
     2029template< typename pass_type >
     2030Designation * PassVisitor< pass_type >::mutate( Designation * node ) {
     2031        MUTATE_START( node );
     2032
     2033        maybeMutate_impl( node->get_designators(), *this );
     2034
     2035        MUTATE_END( Designation, node );
     2036}
     2037
     2038//--------------------------------------------------------------------------
     2039// SingleInit
     2040template< typename pass_type >
     2041void PassVisitor< pass_type >::visit( SingleInit * node ) {
     2042        VISIT_START( node );
     2043
     2044        visitExpression( node->get_value() );
     2045
     2046        VISIT_END( node );
     2047}
     2048
     2049template< typename pass_type >
     2050Initializer * PassVisitor< pass_type >::mutate( SingleInit * node ) {
     2051        MUTATE_START( node );
     2052
     2053        node->set_value( mutateExpression( node->get_value() ) );
     2054
     2055        MUTATE_END( Initializer, node );
     2056}
     2057
     2058template< typename pass_type >
     2059void PassVisitor< pass_type >::visit( ListInit * node ) {
     2060        VISIT_BODY( node );
     2061}
     2062
     2063template< typename pass_type >
     2064void PassVisitor< pass_type >::visit( ConstructorInit * node ) {
     2065        VISIT_BODY( node );
     2066}
     2067
     2068template< typename pass_type >
     2069void PassVisitor< pass_type >::visit( Subrange * node ) {
     2070        VISIT_BODY( node );
     2071}
     2072
     2073template< typename pass_type >
     2074void PassVisitor< pass_type >::visit( Constant * node ) {
     2075        VISIT_BODY( node );
     2076}
     2077
     2078template< typename pass_type >
     2079void PassVisitor< pass_type >::visit( Attribute * node ) {
     2080        VISIT_BODY( node );
     2081}
     2082
     2083//---------------------------------------------------------------------------------------------------------------
     2084template< typename pass_type >
     2085Type * PassVisitor< pass_type >::mutate( VoidType * node ) {
     2086        MUTATE_BODY( Type, node );
     2087}
     2088
     2089template< typename pass_type >
     2090Type * PassVisitor< pass_type >::mutate( BasicType * node ) {
     2091        MUTATE_BODY( Type, node );
     2092}
     2093
     2094template< typename pass_type >
     2095Type * PassVisitor< pass_type >::mutate( PointerType * node ) {
     2096        MUTATE_BODY( Type, node );
     2097}
     2098
     2099template< typename pass_type >
     2100Type * PassVisitor< pass_type >::mutate( ArrayType * node ) {
     2101        MUTATE_BODY( Type, node );
     2102}
     2103
     2104template< typename pass_type >
     2105Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {
     2106        MUTATE_BODY( Type, node );
     2107}
     2108
     2109template< typename pass_type >
     2110Type * PassVisitor< pass_type >::mutate( FunctionType * node ) {
     2111        MUTATE_BODY( Type, node );
    24292112}
    24302113
    24312114template< typename pass_type >
    24322115Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) {
    2433         MUTATE_START( node );
    2434 
    2435         maybeMutate_impl( node->forall    , *this );
    2436         maybeMutate_impl( node->parameters, *this );
    2437 
    2438         MUTATE_END( Type, node );
    2439 }
    2440 
    2441 //--------------------------------------------------------------------------
    2442 // TupleType
    2443 template< typename pass_type >
    2444 void PassVisitor< pass_type >::visit( TupleType * node ) {
    2445         VISIT_START( node );
    2446 
    2447         maybeAccept_impl( node->forall, *this );
    2448         maybeAccept_impl( node->types, *this );
    2449         maybeAccept_impl( node->members, *this );
    2450 
    2451         VISIT_END( node );
     2116        MUTATE_BODY( Type, node );
    24522117}
    24532118
    24542119template< typename pass_type >
    24552120Type * PassVisitor< pass_type >::mutate( TupleType * node ) {
    2456         MUTATE_START( node );
    2457 
    2458         maybeMutate_impl( node->forall, *this );
    2459         maybeMutate_impl( node->types, *this );
    2460         maybeMutate_impl( node->members, *this );
    2461 
    2462         MUTATE_END( Type, node );
    2463 }
    2464 
    2465 //--------------------------------------------------------------------------
    2466 // TypeofType
    2467 template< typename pass_type >
    2468 void PassVisitor< pass_type >::visit( TypeofType * node ) {
    2469         VISIT_START( node );
    2470 
    2471         assert( node->expr );
    2472         maybeAccept_impl( node->expr, *this );
    2473 
    2474         VISIT_END( node );
     2121        MUTATE_BODY( Type, node );
    24752122}
    24762123
    24772124template< typename pass_type >
    24782125Type * PassVisitor< pass_type >::mutate( TypeofType * node ) {
    2479         MUTATE_START( node );
    2480 
    2481         assert( node->expr );
    2482         maybeMutate_impl( node->expr, *this );
    2483 
    2484         MUTATE_END( Type, node );
    2485 }
    2486 
    2487 //--------------------------------------------------------------------------
    2488 // AttrType
    2489 template< typename pass_type >
    2490 void PassVisitor< pass_type >::visit( AttrType * node ) {
    2491         VISIT_START( node );
    2492 
    2493         if ( node->isType ) {
    2494                 assert( node->type );
    2495                 maybeAccept_impl( node->type, *this );
    2496         } else {
    2497                 assert( node->expr );
    2498                 maybeAccept_impl( node->expr, *this );
    2499         } // if
    2500 
    2501         VISIT_END( node );
     2126        MUTATE_BODY( Type, node );
    25022127}
    25032128
    25042129template< typename pass_type >
    25052130Type * PassVisitor< pass_type >::mutate( AttrType * node ) {
    2506         MUTATE_START( node );
    2507 
    2508         if ( node->isType ) {
    2509                 assert( node->type );
    2510                 maybeMutate_impl( node->type, *this );
    2511         } else {
    2512                 assert( node->expr );
    2513                 maybeMutate_impl( node->expr, *this );
    2514         } // if
    2515 
    2516         MUTATE_END( Type, node );
    2517 }
    2518 
    2519 //--------------------------------------------------------------------------
    2520 // VarArgsType
    2521 template< typename pass_type >
    2522 void PassVisitor< pass_type >::visit( VarArgsType * node ) {
    2523         VISIT_START( node );
    2524 
    2525         maybeAccept_impl( node->forall, *this );
    2526 
    2527         VISIT_END( node );
     2131        MUTATE_BODY( Type, node );
    25282132}
    25292133
    25302134template< typename pass_type >
    25312135Type * PassVisitor< pass_type >::mutate( VarArgsType * node ) {
    2532         MUTATE_START( node );
    2533 
    2534         maybeMutate_impl( node->forall, *this );
    2535 
    2536         MUTATE_END( Type, node );
    2537 }
    2538 
    2539 //--------------------------------------------------------------------------
    2540 // ZeroType
    2541 template< typename pass_type >
    2542 void PassVisitor< pass_type >::visit( ZeroType * node ) {
    2543         VISIT_START( node );
    2544 
    2545         maybeAccept_impl( node->forall, *this );
    2546 
    2547         VISIT_END( node );
     2136        MUTATE_BODY( Type, node );
    25482137}
    25492138
    25502139template< typename pass_type >
    25512140Type * PassVisitor< pass_type >::mutate( ZeroType * node ) {
    2552         MUTATE_START( node );
    2553 
    2554         maybeMutate_impl( node->forall, *this );
    2555 
    2556         MUTATE_END( Type, node );
    2557 }
    2558 
    2559 //--------------------------------------------------------------------------
    2560 // OneType
    2561 template< typename pass_type >
    2562 void PassVisitor< pass_type >::visit( OneType * node ) {
    2563         VISIT_START( node );
    2564 
    2565         maybeAccept_impl( node->forall, *this );
    2566 
    2567         VISIT_END( node );
     2141        MUTATE_BODY( Type, node );
    25682142}
    25692143
    25702144template< typename pass_type >
    25712145Type * PassVisitor< pass_type >::mutate( OneType * node ) {
    2572         MUTATE_START( node );
    2573 
    2574         maybeMutate_impl( node->forall, *this );
    2575 
    2576         MUTATE_END( Type, node );
    2577 }
    2578 
    2579 //--------------------------------------------------------------------------
    2580 // GlobalScopeType
    2581 template< typename pass_type >
    2582 void PassVisitor< pass_type >::visit( GlobalScopeType * node ) {
    2583         VISIT_START( node );
    2584 
    2585         maybeAccept_impl( node->forall, *this );
    2586 
    2587         VISIT_END( node );
    2588 }
    2589 
    2590 template< typename pass_type >
    2591 Type * PassVisitor< pass_type >::mutate( GlobalScopeType * node ) {
    2592         MUTATE_START( node );
    2593 
    2594         maybeMutate_impl( node->forall, *this );
    2595 
    2596         MUTATE_END( Type, node );
    2597 }
    2598 
    2599 //--------------------------------------------------------------------------
    2600 // Designation
    2601 template< typename pass_type >
    2602 void PassVisitor< pass_type >::visit( Designation * node ) {
    2603         VISIT_START( node );
    2604 
    2605         maybeAccept_impl( node->designators, *this );
    2606 
    2607         VISIT_END( node );
    2608 }
    2609 
    2610 template< typename pass_type >
    2611 Designation * PassVisitor< pass_type >::mutate( Designation * node ) {
    2612         MUTATE_START( node );
    2613 
    2614         maybeMutate_impl( node->designators, *this );
    2615 
    2616         MUTATE_END( Designation, node );
    2617 }
    2618 
    2619 //--------------------------------------------------------------------------
    2620 // SingleInit
    2621 template< typename pass_type >
    2622 void PassVisitor< pass_type >::visit( SingleInit * node ) {
    2623         VISIT_START( node );
    2624 
    2625         visitExpression( node->value );
    2626 
    2627         VISIT_END( node );
    2628 }
    2629 
    2630 template< typename pass_type >
    2631 Initializer * PassVisitor< pass_type >::mutate( SingleInit * node ) {
    2632         MUTATE_START( node );
    2633 
    2634         node->value = mutateExpression( node->value );
    2635 
    2636         MUTATE_END( Initializer, node );
    2637 }
    2638 
    2639 //--------------------------------------------------------------------------
    2640 // ListInit
    2641 template< typename pass_type >
    2642 void PassVisitor< pass_type >::visit( ListInit * node ) {
    2643         VISIT_START( node );
    2644 
    2645         maybeAccept_impl( node->designations, *this );
    2646         maybeAccept_impl( node->initializers, *this );
    2647 
    2648         VISIT_END( node );
     2146        MUTATE_BODY( Type, node );
    26492147}
    26502148
    26512149template< typename pass_type >
    26522150Initializer * PassVisitor< pass_type >::mutate( ListInit * node ) {
    2653         MUTATE_START( node );
    2654 
    2655         maybeMutate_impl( node->designations, *this );
    2656         maybeMutate_impl( node->initializers, *this );
    2657 
    2658         MUTATE_END( Initializer, node );
    2659 }
    2660 
    2661 //--------------------------------------------------------------------------
    2662 // ConstructorInit
    2663 template< typename pass_type >
    2664 void PassVisitor< pass_type >::visit( ConstructorInit * node ) {
    2665         VISIT_START( node );
    2666 
    2667         maybeAccept_impl( node->ctor, *this );
    2668         maybeAccept_impl( node->dtor, *this );
    2669         maybeAccept_impl( node->init, *this );
    2670 
    2671         VISIT_END( node );
     2151        MUTATE_BODY( Initializer, node );
    26722152}
    26732153
    26742154template< typename pass_type >
    26752155Initializer * PassVisitor< pass_type >::mutate( ConstructorInit * node ) {
    2676         MUTATE_START( node );
    2677 
    2678         maybeMutate_impl( node->ctor, *this );
    2679         maybeMutate_impl( node->dtor, *this );
    2680         maybeMutate_impl( node->init, *this );
    2681 
    2682         MUTATE_END( Initializer, node );
    2683 }
    2684 
    2685 //--------------------------------------------------------------------------
    2686 // Subrange
    2687 template< typename pass_type >
    2688 void PassVisitor< pass_type >::visit( Subrange * node ) {
    2689         VISIT_START( node );
    2690 
    2691         VISIT_END( node );
     2156        MUTATE_BODY( Initializer, node );
    26922157}
    26932158
    26942159template< typename pass_type >
    26952160Subrange * PassVisitor< pass_type >::mutate( Subrange * node  )  {
    2696         MUTATE_START( node );
    2697 
    2698         MUTATE_END( Subrange, node );
    2699 }
    2700 
    2701 //--------------------------------------------------------------------------
    2702 // Attribute
    2703 template< typename pass_type >
    2704 void PassVisitor< pass_type >::visit( Constant * node ) {
    2705         VISIT_START( node );
    2706 
    2707         VISIT_END( node );
     2161        MUTATE_BODY( Subrange, node );
    27082162}
    27092163
    27102164template< typename pass_type >
    27112165Constant * PassVisitor< pass_type >::mutate( Constant * node  )  {
    2712         MUTATE_START( node );
    2713 
    2714         MUTATE_END( Constant, node );
    2715 }
    2716 
    2717 //--------------------------------------------------------------------------
    2718 // Attribute
    2719 template< typename pass_type >
    2720 void PassVisitor< pass_type >::visit( Attribute * node ) {
    2721         VISIT_START( node );
    2722 
    2723         maybeAccept_impl( node->parameters, *this );
    2724 
    2725         VISIT_END( node );
     2166        MUTATE_BODY( Constant, node );
    27262167}
    27272168
    27282169template< typename pass_type >
    27292170Attribute * PassVisitor< pass_type >::mutate( Attribute * node  )  {
    2730         MUTATE_START( node );
    2731 
    2732         maybeMutate_impl( node->parameters, *this );
    2733 
    2734         MUTATE_END( Attribute, node );
    2735 }
    2736 
    2737 //--------------------------------------------------------------------------
    2738 // TypeSubstitution
     2171        MUTATE_BODY( Attribute, node );
     2172}
     2173
    27392174template< typename pass_type >
    27402175TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) {
Note: See TracChangeset for help on using the changeset viewer.