| [13932f14] | 1 | #pragma once
|
|---|
| [3268a58] | 2 | // IWYU pragma: private, include "PassVisitor.h"
|
|---|
| [13932f14] | 3 |
|
|---|
| [6e09f211] | 4 | #define VISIT_START( node ) \
|
|---|
| 5 | __attribute__((unused)) \
|
|---|
| [62423350] | 6 | guard_value_impl guard( at_cleanup_impl(pass, 0) ); \
|
|---|
| [b73bd70] | 7 | bool visit_children = true; \
|
|---|
| 8 | set_visit_children( visit_children ); \
|
|---|
| [6e09f211] | 9 | call_previsit( node ); \
|
|---|
| [b73bd70] | 10 | if( visit_children ) { \
|
|---|
| [6e09f211] | 11 |
|
|---|
| 12 | #define VISIT_END( node ) \
|
|---|
| 13 | } \
|
|---|
| 14 | call_postvisit( node ); \
|
|---|
| [9c1600c] | 15 |
|
|---|
| [6e09f211] | 16 | #define MUTATE_START( node ) \
|
|---|
| 17 | __attribute__((unused)) \
|
|---|
| [62423350] | 18 | guard_value_impl guard( at_cleanup_impl(pass, 0) ); \
|
|---|
| [b73bd70] | 19 | bool visit_children = true; \
|
|---|
| 20 | set_visit_children( visit_children ); \
|
|---|
| [6e09f211] | 21 | call_premutate( node ); \
|
|---|
| [b73bd70] | 22 | if( visit_children ) { \
|
|---|
| [296b2be] | 23 |
|
|---|
| 24 | #define MUTATE_END( type, node ) \
|
|---|
| [7b13aeb] | 25 | } \
|
|---|
| [296b2be] | 26 | return call_postmutate< type * >( node ); \
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| [6e09f211] | 29 | #define VISIT_BODY( node ) \
|
|---|
| 30 | VISIT_START( node ); \
|
|---|
| 31 | Visitor::visit( node ); \
|
|---|
| 32 | VISIT_END( node ); \
|
|---|
| [13932f14] | 33 |
|
|---|
| [ab904dc] | 34 |
|
|---|
| [296b2be] | 35 | #define MUTATE_BODY( type, node ) \
|
|---|
| 36 | MUTATE_START( node ); \
|
|---|
| 37 | Mutator::mutate( node ); \
|
|---|
| 38 | MUTATE_END( type, node ); \
|
|---|
| 39 |
|
|---|
| [134322e] | 40 |
|
|---|
| 41 |
|
|---|
| 42 | template<typename T>
|
|---|
| 43 | static inline bool empty( T * ptr ) {
|
|---|
| 44 | return !ptr || ptr->empty();
|
|---|
| 45 | }
|
|---|
| 46 |
|
|---|
| [6ca154b] | 47 | typedef std::list< Statement * > StmtList_t;
|
|---|
| 48 | typedef std::list< Declaration * > DeclList_t;
|
|---|
| 49 |
|
|---|
| 50 | template<typename iterator_t>
|
|---|
| 51 | static inline void splice( iterator_t it, DeclList_t * decls ) {
|
|---|
| 52 | std::transform(
|
|---|
| 53 | decls->begin(),
|
|---|
| 54 | decls->end(),
|
|---|
| 55 | it,
|
|---|
| 56 | [](Declaration * decl) -> auto {
|
|---|
| 57 | return new DeclStmt( noLabels, decl );
|
|---|
| 58 | }
|
|---|
| 59 | );
|
|---|
| 60 | decls->clear();
|
|---|
| 61 | }
|
|---|
| [134322e] | 62 |
|
|---|
| 63 | template< typename pass_type >
|
|---|
| [6ca154b] | 64 | static inline void acceptAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& visitor ) {
|
|---|
| [134322e] | 65 |
|
|---|
| [6ca154b] | 66 | DeclList_t* beforeDecls = visitor.get_beforeDecls();
|
|---|
| 67 | DeclList_t* afterDecls = visitor.get_afterDecls();
|
|---|
| [522363e] | 68 | SemanticError errors;
|
|---|
| [134322e] | 69 |
|
|---|
| [6ca154b] | 70 | for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
|
|---|
| 71 | // splice in new declarations after previous decl
|
|---|
| [d24d4e1] | 72 | if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); }
|
|---|
| [6ca154b] | 73 |
|
|---|
| 74 | if ( i == decls.end() ) break;
|
|---|
| 75 |
|
|---|
| [522363e] | 76 | try {
|
|---|
| 77 | // run visitor on declaration
|
|---|
| 78 | maybeAccept( *i, visitor );
|
|---|
| 79 | } catch( SemanticError &e ) {
|
|---|
| 80 | e.set_location( (*i)->location );
|
|---|
| 81 | errors.append( e );
|
|---|
| 82 | }
|
|---|
| [6ca154b] | 83 |
|
|---|
| 84 | // splice in new declarations before current decl
|
|---|
| 85 | if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); }
|
|---|
| [134322e] | 86 | }
|
|---|
| [522363e] | 87 | if ( ! errors.isEmpty() ) {
|
|---|
| 88 | throw errors;
|
|---|
| 89 | }
|
|---|
| [6ca154b] | 90 | }
|
|---|
| [134322e] | 91 |
|
|---|
| [6ca154b] | 92 | template< typename pass_type >
|
|---|
| 93 | static inline void mutateAll( std::list< Declaration* > &decls, PassVisitor< pass_type >& mutator ) {
|
|---|
| 94 |
|
|---|
| 95 | DeclList_t* beforeDecls = mutator.get_beforeDecls();
|
|---|
| 96 | DeclList_t* afterDecls = mutator.get_afterDecls();
|
|---|
| [522363e] | 97 | SemanticError errors;
|
|---|
| [6ca154b] | 98 |
|
|---|
| 99 | for ( std::list< Declaration* >::iterator i = decls.begin(); ; ++i ) {
|
|---|
| 100 | // splice in new declarations after previous decl
|
|---|
| [d24d4e1] | 101 | if ( !empty( afterDecls ) ) { decls.splice( i, *afterDecls ); }
|
|---|
| [6ca154b] | 102 |
|
|---|
| 103 | if ( i == decls.end() ) break;
|
|---|
| [522363e] | 104 | try {
|
|---|
| 105 | // run mutator on declaration
|
|---|
| 106 | *i = maybeMutate( *i, mutator );
|
|---|
| 107 | } catch( SemanticError &e ) {
|
|---|
| 108 | e.set_location( (*i)->location );
|
|---|
| 109 | errors.append( e );
|
|---|
| 110 | }
|
|---|
| [6ca154b] | 111 |
|
|---|
| 112 | // splice in new declarations before current decl
|
|---|
| 113 | if ( !empty( beforeDecls ) ) { decls.splice( i, *beforeDecls ); }
|
|---|
| 114 | }
|
|---|
| [522363e] | 115 | if ( ! errors.isEmpty() ) {
|
|---|
| 116 | throw errors;
|
|---|
| 117 | }
|
|---|
| [134322e] | 118 | }
|
|---|
| 119 |
|
|---|
| [e0886db] | 120 | template< typename Container, typename VisitorType >
|
|---|
| 121 | inline void maybeAccept( Container &container, VisitorType &visitor ) {
|
|---|
| 122 | SemanticError errors;
|
|---|
| 123 | for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
|
|---|
| 124 | try {
|
|---|
| 125 | if ( *i ) {
|
|---|
| 126 | (*i)->accept( visitor );
|
|---|
| 127 | }
|
|---|
| 128 | } catch( SemanticError &e ) {
|
|---|
| 129 | e.set_location( (*i)->location );
|
|---|
| 130 | errors.append( e );
|
|---|
| 131 | }
|
|---|
| 132 | }
|
|---|
| 133 | if ( ! errors.isEmpty() ) {
|
|---|
| 134 | throw errors;
|
|---|
| 135 | }
|
|---|
| 136 | }
|
|---|
| 137 |
|
|---|
| 138 | template< typename Container, typename MutatorType >
|
|---|
| 139 | inline void maybeMutateRef( Container &container, MutatorType &mutator ) {
|
|---|
| 140 | SemanticError errors;
|
|---|
| 141 | for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
|
|---|
| 142 | try {
|
|---|
| 143 | if ( *i ) {
|
|---|
| 144 | /// *i = (*i)->acceptMutator( mutator );
|
|---|
| 145 | *i = dynamic_cast< typename Container::value_type >( (*i)->acceptMutator( mutator ) );
|
|---|
| 146 | assert( *i );
|
|---|
| 147 | } // if
|
|---|
| 148 | } catch( SemanticError &e ) {
|
|---|
| 149 | e.set_location( (*i)->location );
|
|---|
| 150 | errors.append( e );
|
|---|
| 151 | } // try
|
|---|
| 152 | } // for
|
|---|
| 153 | if ( ! errors.isEmpty() ) {
|
|---|
| 154 | throw errors;
|
|---|
| 155 | } // if
|
|---|
| 156 | }
|
|---|
| 157 |
|
|---|
| [296b2be] | 158 | template< typename pass_type >
|
|---|
| [6ca154b] | 159 | template< typename func_t >
|
|---|
| 160 | void PassVisitor< pass_type >::handleStatementList( std::list< Statement * > & statements, func_t func ) {
|
|---|
| [296b2be] | 161 | SemanticError errors;
|
|---|
| 162 |
|
|---|
| [2a7b3ca] | 163 | // don't want statements from outer CompoundStmts to be added to this CompoundStmt
|
|---|
| 164 | ValueGuardPtr< StmtList_t > oldBeforeStmts( get_beforeStmts() );
|
|---|
| 165 | ValueGuardPtr< StmtList_t > oldAfterStmts ( get_afterStmts () );
|
|---|
| 166 | ValueGuardPtr< DeclList_t > oldBeforeDecls( get_beforeDecls() );
|
|---|
| 167 | ValueGuardPtr< DeclList_t > oldAfterDecls ( get_afterDecls () );
|
|---|
| 168 |
|
|---|
| [134322e] | 169 | StmtList_t* beforeStmts = get_beforeStmts();
|
|---|
| 170 | StmtList_t* afterStmts = get_afterStmts();
|
|---|
| [6ca154b] | 171 | DeclList_t* beforeDecls = get_beforeDecls();
|
|---|
| 172 | DeclList_t* afterDecls = get_afterDecls();
|
|---|
| [134322e] | 173 |
|
|---|
| [296b2be] | 174 | for ( std::list< Statement* >::iterator i = statements.begin(); i != statements.end(); ++i ) {
|
|---|
| [6ca154b] | 175 |
|
|---|
| 176 | if ( !empty( afterDecls ) ) { splice( std::inserter( statements, i ), afterDecls ); }
|
|---|
| [134322e] | 177 | if ( !empty( afterStmts ) ) { statements.splice( i, *afterStmts ); }
|
|---|
| [6ca154b] | 178 |
|
|---|
| [296b2be] | 179 | try {
|
|---|
| [6ca154b] | 180 | func( *i );
|
|---|
| 181 | assert(( empty( beforeStmts ) && empty( afterStmts ))
|
|---|
| 182 | || ( empty( beforeDecls ) && empty( afterDecls )) );
|
|---|
| 183 |
|
|---|
| [296b2be] | 184 | } catch ( SemanticError &e ) {
|
|---|
| 185 | errors.append( e );
|
|---|
| [134322e] | 186 | }
|
|---|
| [6ca154b] | 187 |
|
|---|
| 188 | if ( !empty( beforeDecls ) ) { splice( std::inserter( statements, i ), beforeDecls ); }
|
|---|
| [134322e] | 189 | if ( !empty( beforeStmts ) ) { statements.splice( i, *beforeStmts ); }
|
|---|
| [296b2be] | 190 | }
|
|---|
| [134322e] | 191 |
|
|---|
| [6ca154b] | 192 | if ( !empty( afterDecls ) ) { splice( std::back_inserter( statements ), afterDecls); }
|
|---|
| [134322e] | 193 | if ( !empty( afterStmts ) ) { statements.splice( statements.end(), *afterStmts ); }
|
|---|
| 194 | if ( !errors.isEmpty() ) { throw errors; }
|
|---|
| [296b2be] | 195 | }
|
|---|
| 196 |
|
|---|
| 197 | template< typename pass_type >
|
|---|
| [6ca154b] | 198 | void PassVisitor< pass_type >::visitStatementList( std::list< Statement * > & statements ) {
|
|---|
| 199 | handleStatementList( statements, [this]( Statement * stmt) {
|
|---|
| 200 | stmt->accept( *this );
|
|---|
| 201 | });
|
|---|
| 202 | }
|
|---|
| [134322e] | 203 |
|
|---|
| [6ca154b] | 204 | template< typename pass_type >
|
|---|
| 205 | void PassVisitor< pass_type >::mutateStatementList( std::list< Statement * > & statements ) {
|
|---|
| 206 | handleStatementList( statements, [this]( Statement *& stmt) {
|
|---|
| 207 | stmt = stmt->acceptMutator( *this );
|
|---|
| 208 | });
|
|---|
| [134322e] | 209 | }
|
|---|
| 210 |
|
|---|
| [6ca154b] | 211 |
|
|---|
| [134322e] | 212 | template< typename pass_type >
|
|---|
| [6ca154b] | 213 | template< typename func_t >
|
|---|
| 214 | Statement * PassVisitor< pass_type >::handleStatement( Statement * stmt, func_t func ) {
|
|---|
| [134322e] | 215 | // don't want statements from outer CompoundStmts to be added to this CompoundStmt
|
|---|
| [6ca154b] | 216 | ValueGuardPtr< TypeSubstitution * > oldEnv ( get_env_ptr () );
|
|---|
| 217 | ValueGuardPtr< DeclList_t > oldBeforeDecls( get_beforeDecls() );
|
|---|
| 218 | ValueGuardPtr< DeclList_t > oldAfterDecls ( get_afterDecls () );
|
|---|
| 219 | ValueGuardPtr< StmtList_t > oldBeforeStmts( get_beforeStmts() );
|
|---|
| 220 | ValueGuardPtr< StmtList_t > oldAfterStmts ( get_afterStmts () );
|
|---|
| [296b2be] | 221 |
|
|---|
| [6ca154b] | 222 | Statement *newStmt = func( stmt );
|
|---|
| [134322e] | 223 |
|
|---|
| 224 | StmtList_t* beforeStmts = get_beforeStmts();
|
|---|
| 225 | StmtList_t* afterStmts = get_afterStmts();
|
|---|
| [6ca154b] | 226 | DeclList_t* beforeDecls = get_beforeDecls();
|
|---|
| 227 | DeclList_t* afterDecls = get_afterDecls();
|
|---|
| [134322e] | 228 |
|
|---|
| [6ca154b] | 229 | if( empty(beforeStmts) && empty(afterStmts) && empty(beforeDecls) && empty(afterDecls) ) { return newStmt; }
|
|---|
| 230 | assert(( empty( beforeStmts ) && empty( afterStmts ))
|
|---|
| 231 | || ( empty( beforeDecls ) && empty( afterDecls )) );
|
|---|
| [134322e] | 232 |
|
|---|
| 233 | CompoundStmt *compound = new CompoundStmt( noLabels );
|
|---|
| [6ca154b] | 234 | if( !empty(beforeDecls) ) { splice( std::back_inserter( compound->get_kids() ), beforeDecls ); }
|
|---|
| [134322e] | 235 | if( !empty(beforeStmts) ) { compound->get_kids().splice( compound->get_kids().end(), *beforeStmts ); }
|
|---|
| 236 | compound->get_kids().push_back( newStmt );
|
|---|
| [6ca154b] | 237 | if( !empty(afterDecls) ) { splice( std::back_inserter( compound->get_kids() ), afterDecls ); }
|
|---|
| [134322e] | 238 | if( !empty(afterStmts) ) { compound->get_kids().splice( compound->get_kids().end(), *afterStmts ); }
|
|---|
| 239 | return compound;
|
|---|
| 240 | }
|
|---|
| 241 |
|
|---|
| 242 | template< typename pass_type >
|
|---|
| [6ca154b] | 243 | Statement * PassVisitor< pass_type >::visitStatement( Statement * stmt ) {
|
|---|
| 244 | return handleStatement( stmt, [this]( Statement * stmt ) {
|
|---|
| [d24d4e1] | 245 | maybeAccept( stmt, *this );
|
|---|
| [6ca154b] | 246 | return stmt;
|
|---|
| 247 | });
|
|---|
| 248 | }
|
|---|
| [134322e] | 249 |
|
|---|
| [6ca154b] | 250 | template< typename pass_type >
|
|---|
| 251 | Statement * PassVisitor< pass_type >::mutateStatement( Statement * stmt ) {
|
|---|
| 252 | return handleStatement( stmt, [this]( Statement * stmt ) {
|
|---|
| 253 | return maybeMutate( stmt, *this );
|
|---|
| 254 | });
|
|---|
| [296b2be] | 255 | }
|
|---|
| 256 |
|
|---|
| 257 | template< typename pass_type >
|
|---|
| [6ca154b] | 258 | template< typename func_t >
|
|---|
| 259 | Expression * PassVisitor< pass_type >::handleExpression( Expression * expr, func_t func ) {
|
|---|
| [296b2be] | 260 | if( !expr ) return nullptr;
|
|---|
| 261 |
|
|---|
| [134322e] | 262 | auto env_ptr = get_env_ptr();
|
|---|
| 263 | if ( env_ptr && expr->get_env() ) {
|
|---|
| 264 | *env_ptr = expr->get_env();
|
|---|
| [296b2be] | 265 | }
|
|---|
| [6ca154b] | 266 |
|
|---|
| 267 | // should env be cloned (or moved) onto the result of the mutate?
|
|---|
| 268 | return func( expr );
|
|---|
| 269 | }
|
|---|
| 270 |
|
|---|
| 271 | template< typename pass_type >
|
|---|
| 272 | Expression * PassVisitor< pass_type >::visitExpression( Expression * expr ) {
|
|---|
| 273 | return handleExpression(expr, [this]( Expression * expr ) {
|
|---|
| 274 | expr->accept( *this );
|
|---|
| 275 | return expr;
|
|---|
| [d24d4e1] | 276 | });
|
|---|
| [296b2be] | 277 | }
|
|---|
| [ab904dc] | 278 |
|
|---|
| [6ca154b] | 279 | template< typename pass_type >
|
|---|
| 280 | Expression * PassVisitor< pass_type >::mutateExpression( Expression * expr ) {
|
|---|
| 281 | return handleExpression(expr, [this]( Expression * expr ) {
|
|---|
| 282 | return expr->acceptMutator( *this );
|
|---|
| 283 | });
|
|---|
| 284 | }
|
|---|
| [ab904dc] | 285 |
|
|---|
| [296b2be] | 286 | //------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|---|
| [e0886db] | 287 | //========================================================================================================================================================================
|
|---|
| 288 | //========================================================================================================================================================================
|
|---|
| 289 | //========================================================================================================================================================================
|
|---|
| 290 | //========================================================================================================================================================================
|
|---|
| 291 | //========================================================================================================================================================================
|
|---|
| 292 | //------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|---|
| [13932f14] | 293 |
|
|---|
| [e0886db] | 294 |
|
|---|
| 295 | //--------------------------------------------------------------------------
|
|---|
| 296 | // ObjectDecl
|
|---|
| [13932f14] | 297 | template< typename pass_type >
|
|---|
| [ab904dc] | 298 | void PassVisitor< pass_type >::visit( ObjectDecl * node ) {
|
|---|
| [e0886db] | 299 | VISIT_START( node );
|
|---|
| 300 |
|
|---|
| 301 | indexerScopedAccept( node->type , *this );
|
|---|
| 302 | maybeAccept ( node->init , *this );
|
|---|
| 303 | maybeAccept ( node->bitfieldWidth, *this );
|
|---|
| 304 |
|
|---|
| 305 | if ( node->name != "" ) {
|
|---|
| 306 | indexerAddId( node );
|
|---|
| 307 | }
|
|---|
| 308 |
|
|---|
| 309 | VISIT_END( node );
|
|---|
| 310 | }
|
|---|
| 311 |
|
|---|
| 312 | template< typename pass_type >
|
|---|
| 313 | DeclarationWithType * PassVisitor< pass_type >::mutate( ObjectDecl * node ) {
|
|---|
| 314 | MUTATE_START( node );
|
|---|
| 315 |
|
|---|
| 316 | indexerScopedMutate( node->type , *this );
|
|---|
| 317 | maybeMutateRef ( node->init , *this );
|
|---|
| 318 | maybeMutateRef ( node->bitfieldWidth, *this );
|
|---|
| 319 |
|
|---|
| 320 | if ( node->name != "" ) {
|
|---|
| 321 | indexerAddId( node );
|
|---|
| 322 | }
|
|---|
| 323 |
|
|---|
| 324 | MUTATE_END( DeclarationWithType, node );
|
|---|
| [13932f14] | 325 | }
|
|---|
| 326 |
|
|---|
| [e0886db] | 327 | //--------------------------------------------------------------------------
|
|---|
| 328 | // FunctionDecl
|
|---|
| [13932f14] | 329 | template< typename pass_type >
|
|---|
| [ab904dc] | 330 | void PassVisitor< pass_type >::visit( FunctionDecl * node ) {
|
|---|
| [e0886db] | 331 | VISIT_START( node );
|
|---|
| 332 |
|
|---|
| 333 | if ( node->name != "" ) {
|
|---|
| 334 | indexerAddId( node );
|
|---|
| 335 | }
|
|---|
| 336 |
|
|---|
| 337 | {
|
|---|
| 338 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 339 | maybeAccept( node->type, *this );
|
|---|
| 340 | maybeAccept( node->statements, *this );
|
|---|
| 341 | }
|
|---|
| 342 |
|
|---|
| 343 | VISIT_END( node );
|
|---|
| 344 | }
|
|---|
| 345 |
|
|---|
| 346 | template< typename pass_type >
|
|---|
| 347 | DeclarationWithType * PassVisitor< pass_type >::mutate( FunctionDecl * node ) {
|
|---|
| 348 | MUTATE_START( node );
|
|---|
| 349 |
|
|---|
| 350 | if ( node->name != "" ) {
|
|---|
| 351 | indexerAddId( node );
|
|---|
| 352 | }
|
|---|
| 353 |
|
|---|
| 354 | {
|
|---|
| 355 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 356 | maybeMutateRef( node->type, *this );
|
|---|
| 357 | maybeMutateRef( node->statements, *this );
|
|---|
| 358 | }
|
|---|
| 359 |
|
|---|
| 360 | MUTATE_END( DeclarationWithType, node );
|
|---|
| [13932f14] | 361 | }
|
|---|
| 362 |
|
|---|
| [e0886db] | 363 | //--------------------------------------------------------------------------
|
|---|
| 364 | // StructDecl
|
|---|
| [13932f14] | 365 | template< typename pass_type >
|
|---|
| [ab904dc] | 366 | void PassVisitor< pass_type >::visit( StructDecl * node ) {
|
|---|
| [e0886db] | 367 | VISIT_START( node );
|
|---|
| 368 |
|
|---|
| 369 | // make up a forward declaration and add it before processing the members
|
|---|
| 370 | // needs to be on the heap because addStruct saves the pointer
|
|---|
| 371 | indexerAddStructFwd( node );
|
|---|
| 372 |
|
|---|
| 373 | {
|
|---|
| 374 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 375 | maybeAccept( node->parameters, *this );
|
|---|
| 376 | maybeAccept( node->members , *this );
|
|---|
| 377 | }
|
|---|
| 378 |
|
|---|
| 379 | // this addition replaces the forward declaration
|
|---|
| 380 | indexerAddStruct( node );
|
|---|
| 381 |
|
|---|
| 382 | VISIT_END( node );
|
|---|
| 383 | }
|
|---|
| 384 |
|
|---|
| 385 | template< typename pass_type >
|
|---|
| 386 | Declaration * PassVisitor< pass_type >::mutate( StructDecl * node ) {
|
|---|
| 387 | MUTATE_START( node );
|
|---|
| 388 |
|
|---|
| 389 | // make up a forward declaration and add it before processing the members
|
|---|
| 390 | // needs to be on the heap because addStruct saves the pointer
|
|---|
| 391 | indexerAddStructFwd( node );
|
|---|
| 392 |
|
|---|
| 393 | {
|
|---|
| 394 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 395 | maybeMutateRef( node->parameters, *this );
|
|---|
| 396 | maybeMutateRef( node->members , *this );
|
|---|
| 397 | }
|
|---|
| 398 |
|
|---|
| 399 | // this addition replaces the forward declaration
|
|---|
| 400 | indexerAddStruct( node );
|
|---|
| 401 |
|
|---|
| 402 | MUTATE_END( Declaration, node );
|
|---|
| [13932f14] | 403 | }
|
|---|
| 404 |
|
|---|
| [e0886db] | 405 | //--------------------------------------------------------------------------
|
|---|
| 406 | // UnionDecl
|
|---|
| [13932f14] | 407 | template< typename pass_type >
|
|---|
| [ab904dc] | 408 | void PassVisitor< pass_type >::visit( UnionDecl * node ) {
|
|---|
| [e0886db] | 409 | VISIT_START( node );
|
|---|
| 410 |
|
|---|
| 411 | // make up a forward declaration and add it before processing the members
|
|---|
| 412 | indexerAddUnionFwd( node );
|
|---|
| 413 |
|
|---|
| 414 | {
|
|---|
| 415 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 416 | maybeAccept( node->parameters, *this );
|
|---|
| 417 | maybeAccept( node->members , *this );
|
|---|
| 418 | }
|
|---|
| 419 |
|
|---|
| 420 | indexerAddUnion( node );
|
|---|
| 421 |
|
|---|
| 422 | VISIT_END( node );
|
|---|
| 423 | }
|
|---|
| 424 |
|
|---|
| 425 | template< typename pass_type >
|
|---|
| 426 | Declaration * PassVisitor< pass_type >::mutate( UnionDecl * node ) {
|
|---|
| 427 | MUTATE_START( node );
|
|---|
| 428 |
|
|---|
| 429 | // make up a forward declaration and add it before processing the members
|
|---|
| 430 | indexerAddUnionFwd( node );
|
|---|
| 431 |
|
|---|
| 432 | {
|
|---|
| 433 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 434 | maybeMutateRef( node->parameters, *this );
|
|---|
| 435 | maybeMutateRef( node->members , *this );
|
|---|
| 436 | }
|
|---|
| 437 |
|
|---|
| 438 | indexerAddUnion( node );
|
|---|
| 439 |
|
|---|
| 440 | MUTATE_END( Declaration, node );
|
|---|
| [13932f14] | 441 | }
|
|---|
| 442 |
|
|---|
| [e0886db] | 443 | //--------------------------------------------------------------------------
|
|---|
| 444 | // EnumDecl
|
|---|
| [13932f14] | 445 | template< typename pass_type >
|
|---|
| [ab904dc] | 446 | void PassVisitor< pass_type >::visit( EnumDecl * node ) {
|
|---|
| [e0886db] | 447 | VISIT_START( node );
|
|---|
| 448 |
|
|---|
| 449 | indexerAddEnum( node );
|
|---|
| 450 |
|
|---|
| 451 | // unlike structs, contexts, and unions, enums inject their members into the global scope
|
|---|
| 452 | maybeAccept( node->parameters, *this );
|
|---|
| 453 | maybeAccept( node->members , *this );
|
|---|
| 454 |
|
|---|
| 455 | VISIT_END( node );
|
|---|
| [13932f14] | 456 | }
|
|---|
| 457 |
|
|---|
| [e0886db] | 458 | template< typename pass_type >
|
|---|
| 459 | Declaration * PassVisitor< pass_type >::mutate( EnumDecl * node ) {
|
|---|
| 460 | MUTATE_START( node );
|
|---|
| 461 |
|
|---|
| 462 | indexerAddEnum( node );
|
|---|
| 463 |
|
|---|
| [522363e] | 464 | // unlike structs, traits, and unions, enums inject their members into the global scope
|
|---|
| [e0886db] | 465 | maybeMutateRef( node->parameters, *this );
|
|---|
| 466 | maybeMutateRef( node->members , *this );
|
|---|
| 467 |
|
|---|
| 468 | MUTATE_END( Declaration, node );
|
|---|
| 469 | }
|
|---|
| 470 |
|
|---|
| 471 | //--------------------------------------------------------------------------
|
|---|
| 472 | // TraitDecl
|
|---|
| [13932f14] | 473 | template< typename pass_type >
|
|---|
| [ab904dc] | 474 | void PassVisitor< pass_type >::visit( TraitDecl * node ) {
|
|---|
| [e0886db] | 475 | VISIT_START( node );
|
|---|
| 476 |
|
|---|
| 477 | {
|
|---|
| 478 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 479 | maybeAccept( node->parameters, *this );
|
|---|
| 480 | maybeAccept( node->members , *this );
|
|---|
| 481 | }
|
|---|
| 482 |
|
|---|
| 483 | indexerAddTrait( node );
|
|---|
| 484 |
|
|---|
| 485 | VISIT_END( node );
|
|---|
| [13932f14] | 486 | }
|
|---|
| 487 |
|
|---|
| [e0886db] | 488 | template< typename pass_type >
|
|---|
| 489 | Declaration * PassVisitor< pass_type >::mutate( TraitDecl * node ) {
|
|---|
| 490 | MUTATE_START( node );
|
|---|
| 491 |
|
|---|
| 492 | {
|
|---|
| 493 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 494 | maybeMutateRef( node->parameters, *this );
|
|---|
| 495 | maybeMutateRef( node->members , *this );
|
|---|
| 496 | }
|
|---|
| 497 |
|
|---|
| 498 | indexerAddTrait( node );
|
|---|
| 499 |
|
|---|
| 500 | MUTATE_END( Declaration, node );
|
|---|
| 501 | }
|
|---|
| 502 |
|
|---|
| 503 | //--------------------------------------------------------------------------
|
|---|
| 504 | // TypeDecl
|
|---|
| [13932f14] | 505 | template< typename pass_type >
|
|---|
| [ab904dc] | 506 | void PassVisitor< pass_type >::visit( TypeDecl * node ) {
|
|---|
| [e0886db] | 507 | VISIT_START( node );
|
|---|
| 508 |
|
|---|
| 509 | {
|
|---|
| 510 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 511 | maybeAccept( node->parameters, *this );
|
|---|
| 512 | maybeAccept( node->base , *this );
|
|---|
| 513 | }
|
|---|
| 514 |
|
|---|
| 515 | indexerAddType( node );
|
|---|
| 516 |
|
|---|
| 517 | maybeAccept( node->assertions, *this );
|
|---|
| 518 |
|
|---|
| 519 | indexerScopedAccept( node->init, *this );
|
|---|
| 520 |
|
|---|
| 521 | VISIT_END( node );
|
|---|
| 522 | }
|
|---|
| 523 |
|
|---|
| 524 | template< typename pass_type >
|
|---|
| [982832e] | 525 | Declaration * PassVisitor< pass_type >::mutate( TypeDecl * node ) {
|
|---|
| [e0886db] | 526 | MUTATE_START( node );
|
|---|
| 527 |
|
|---|
| 528 | {
|
|---|
| 529 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 530 | maybeMutateRef( node->parameters, *this );
|
|---|
| 531 | maybeMutateRef( node->base , *this );
|
|---|
| 532 | }
|
|---|
| 533 |
|
|---|
| 534 | indexerAddType( node );
|
|---|
| 535 |
|
|---|
| 536 | maybeMutateRef( node->assertions, *this );
|
|---|
| 537 |
|
|---|
| 538 | indexerScopedMutate( node->init, *this );
|
|---|
| 539 |
|
|---|
| [982832e] | 540 | MUTATE_END( Declaration, node );
|
|---|
| [13932f14] | 541 | }
|
|---|
| 542 |
|
|---|
| [e0886db] | 543 | //--------------------------------------------------------------------------
|
|---|
| 544 | // TypedefDecl
|
|---|
| [13932f14] | 545 | template< typename pass_type >
|
|---|
| [ab904dc] | 546 | void PassVisitor< pass_type >::visit( TypedefDecl * node ) {
|
|---|
| [e0886db] | 547 | VISIT_START( node );
|
|---|
| 548 |
|
|---|
| 549 | {
|
|---|
| 550 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 551 | maybeAccept( node->parameters, *this );
|
|---|
| 552 | maybeAccept( node->base , *this );
|
|---|
| 553 | }
|
|---|
| 554 |
|
|---|
| 555 | indexerAddType( node );
|
|---|
| 556 |
|
|---|
| 557 | maybeAccept( node->assertions, *this );
|
|---|
| 558 |
|
|---|
| 559 | VISIT_END( node );
|
|---|
| [13932f14] | 560 | }
|
|---|
| 561 |
|
|---|
| 562 | template< typename pass_type >
|
|---|
| [e0886db] | 563 | Declaration * PassVisitor< pass_type >::mutate( TypedefDecl * node ) {
|
|---|
| 564 | MUTATE_START( node );
|
|---|
| 565 |
|
|---|
| 566 | {
|
|---|
| 567 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 568 | maybeMutateRef ( node->parameters, *this );
|
|---|
| 569 | maybeMutateRef( node->base , *this );
|
|---|
| 570 | }
|
|---|
| 571 |
|
|---|
| 572 | indexerAddType( node );
|
|---|
| 573 |
|
|---|
| 574 | maybeMutateRef( node->assertions, *this );
|
|---|
| 575 |
|
|---|
| 576 | MUTATE_END( Declaration, node );
|
|---|
| [13932f14] | 577 | }
|
|---|
| 578 |
|
|---|
| [9c1600c] | 579 | //--------------------------------------------------------------------------
|
|---|
| [e0886db] | 580 | // AsmDecl
|
|---|
| [13932f14] | 581 | template< typename pass_type >
|
|---|
| [e0886db] | 582 | void PassVisitor< pass_type >::visit( AsmDecl * node ) {
|
|---|
| [9c1600c] | 583 | VISIT_START( node );
|
|---|
| 584 |
|
|---|
| [e0886db] | 585 | maybeAccept( node->stmt, *this );
|
|---|
| [9c1600c] | 586 |
|
|---|
| 587 | VISIT_END( node );
|
|---|
| [13932f14] | 588 | }
|
|---|
| 589 |
|
|---|
| [296b2be] | 590 | template< typename pass_type >
|
|---|
| [e0886db] | 591 | AsmDecl * PassVisitor< pass_type >::mutate( AsmDecl * node ) {
|
|---|
| [296b2be] | 592 | MUTATE_START( node );
|
|---|
| 593 |
|
|---|
| [e0886db] | 594 | maybeMutateRef( node->stmt, *this );
|
|---|
| 595 |
|
|---|
| 596 | MUTATE_END( AsmDecl, node );
|
|---|
| 597 | }
|
|---|
| 598 |
|
|---|
| 599 | //--------------------------------------------------------------------------
|
|---|
| 600 | // CompoundStmt
|
|---|
| 601 | template< typename pass_type >
|
|---|
| 602 | void PassVisitor< pass_type >::visit( CompoundStmt * node ) {
|
|---|
| 603 | VISIT_START( node );
|
|---|
| 604 | {
|
|---|
| 605 | auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 606 | auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } );
|
|---|
| 607 | visitStatementList( node->kids );
|
|---|
| 608 | }
|
|---|
| 609 | VISIT_END( node );
|
|---|
| 610 | }
|
|---|
| [296b2be] | 611 |
|
|---|
| [e0886db] | 612 | template< typename pass_type >
|
|---|
| 613 | CompoundStmt * PassVisitor< pass_type >::mutate( CompoundStmt * node ) {
|
|---|
| 614 | MUTATE_START( node );
|
|---|
| 615 | {
|
|---|
| 616 | auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 617 | auto guard2 = makeFuncGuard( [this]() { call_beginScope(); }, [this]() { call_endScope(); } );
|
|---|
| 618 | mutateStatementList( node->kids );
|
|---|
| 619 | }
|
|---|
| [296b2be] | 620 | MUTATE_END( CompoundStmt, node );
|
|---|
| 621 | }
|
|---|
| 622 |
|
|---|
| [9c1600c] | 623 | //--------------------------------------------------------------------------
|
|---|
| 624 | // ExprStmt
|
|---|
| [13932f14] | 625 | template< typename pass_type >
|
|---|
| [ab904dc] | 626 | void PassVisitor< pass_type >::visit( ExprStmt * node ) {
|
|---|
| [9c1600c] | 627 | VISIT_START( node );
|
|---|
| 628 |
|
|---|
| [e0886db] | 629 | visitExpression( node->expr );
|
|---|
| [9c1600c] | 630 |
|
|---|
| 631 | VISIT_END( node );
|
|---|
| [13932f14] | 632 | }
|
|---|
| 633 |
|
|---|
| [296b2be] | 634 | template< typename pass_type >
|
|---|
| 635 | Statement * PassVisitor< pass_type >::mutate( ExprStmt * node ) {
|
|---|
| 636 | MUTATE_START( node );
|
|---|
| 637 |
|
|---|
| [e0886db] | 638 | node->expr = mutateExpression( node->expr );
|
|---|
| [296b2be] | 639 |
|
|---|
| 640 | MUTATE_END( Statement, node );
|
|---|
| 641 | }
|
|---|
| 642 |
|
|---|
| [6ca154b] | 643 | //--------------------------------------------------------------------------
|
|---|
| 644 | // AsmStmt
|
|---|
| [13932f14] | 645 | template< typename pass_type >
|
|---|
| [ab904dc] | 646 | void PassVisitor< pass_type >::visit( AsmStmt * node ) {
|
|---|
| [4551a6e] | 647 | VISIT_BODY( node );
|
|---|
| [13932f14] | 648 | }
|
|---|
| 649 |
|
|---|
| [6ca154b] | 650 | template< typename pass_type >
|
|---|
| 651 | Statement * PassVisitor< pass_type >::mutate( AsmStmt * node ) {
|
|---|
| 652 | MUTATE_BODY( Statement, node );
|
|---|
| 653 | }
|
|---|
| 654 |
|
|---|
| [9c1600c] | 655 | //--------------------------------------------------------------------------
|
|---|
| 656 | // IfStmt
|
|---|
| [13932f14] | 657 | template< typename pass_type >
|
|---|
| [ab904dc] | 658 | void PassVisitor< pass_type >::visit( IfStmt * node ) {
|
|---|
| [4551a6e] | 659 | VISIT_START( node );
|
|---|
| [9c1600c] | 660 |
|
|---|
| [e0886db] | 661 | visitExpression( node->condition );
|
|---|
| 662 | node->thenPart = visitStatement( node->thenPart );
|
|---|
| 663 | node->elsePart = visitStatement( node->elsePart );
|
|---|
| [9c1600c] | 664 |
|
|---|
| 665 | VISIT_END( node );
|
|---|
| [13932f14] | 666 | }
|
|---|
| 667 |
|
|---|
| [296b2be] | 668 | template< typename pass_type >
|
|---|
| 669 | Statement * PassVisitor< pass_type >::mutate( IfStmt * node ) {
|
|---|
| [4551a6e] | 670 | MUTATE_START( node );
|
|---|
| [e0886db] | 671 | {
|
|---|
| 672 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 673 | node->condition = mutateExpression( node->condition );
|
|---|
| 674 | node->thenPart = mutateStatement ( node->thenPart );
|
|---|
| 675 | node->elsePart = mutateStatement ( node->elsePart );
|
|---|
| 676 | }
|
|---|
| [296b2be] | 677 | MUTATE_END( Statement, node );
|
|---|
| 678 | }
|
|---|
| 679 |
|
|---|
| [9c1600c] | 680 | //--------------------------------------------------------------------------
|
|---|
| 681 | // WhileStmt
|
|---|
| [13932f14] | 682 | template< typename pass_type >
|
|---|
| [ab904dc] | 683 | void PassVisitor< pass_type >::visit( WhileStmt * node ) {
|
|---|
| [4551a6e] | 684 | VISIT_START( node );
|
|---|
| [9c1600c] | 685 |
|
|---|
| [e0886db] | 686 | visitExpression( node->condition );
|
|---|
| 687 | node->body = visitStatement( node->body );
|
|---|
| [9c1600c] | 688 |
|
|---|
| 689 | VISIT_END( node );
|
|---|
| [13932f14] | 690 | }
|
|---|
| 691 |
|
|---|
| [296b2be] | 692 | template< typename pass_type >
|
|---|
| 693 | Statement * PassVisitor< pass_type >::mutate( WhileStmt * node ) {
|
|---|
| [4551a6e] | 694 | MUTATE_START( node );
|
|---|
| [296b2be] | 695 |
|
|---|
| [e0886db] | 696 | node->condition = mutateExpression( node->condition );
|
|---|
| 697 | node->body = mutateStatement ( node->body );
|
|---|
| [296b2be] | 698 |
|
|---|
| 699 | MUTATE_END( Statement, node );
|
|---|
| 700 | }
|
|---|
| 701 |
|
|---|
| [9c1600c] | 702 | //--------------------------------------------------------------------------
|
|---|
| [6ca154b] | 703 | // ForStmt
|
|---|
| [13932f14] | 704 | template< typename pass_type >
|
|---|
| [ab904dc] | 705 | void PassVisitor< pass_type >::visit( ForStmt * node ) {
|
|---|
| [4551a6e] | 706 | VISIT_START( node );
|
|---|
| [e0886db] | 707 | {
|
|---|
| 708 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 709 | maybeAccept( node->initialization, *this );
|
|---|
| 710 | visitExpression( node->condition );
|
|---|
| 711 | visitExpression( node->increment );
|
|---|
| 712 | node->body = visitStatement( node->body );
|
|---|
| 713 | }
|
|---|
| [9c1600c] | 714 | VISIT_END( node );
|
|---|
| [13932f14] | 715 | }
|
|---|
| 716 |
|
|---|
| [296b2be] | 717 | template< typename pass_type >
|
|---|
| 718 | Statement * PassVisitor< pass_type >::mutate( ForStmt * node ) {
|
|---|
| [4551a6e] | 719 | MUTATE_START( node );
|
|---|
| [e0886db] | 720 | {
|
|---|
| 721 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 722 | maybeMutateRef( node->initialization, *this );
|
|---|
| 723 | node->condition = mutateExpression( node->condition );
|
|---|
| 724 | node->increment = mutateExpression( node->increment );
|
|---|
| 725 | node->body = mutateStatement ( node->body );
|
|---|
| 726 | }
|
|---|
| [296b2be] | 727 | MUTATE_END( Statement, node );
|
|---|
| 728 | }
|
|---|
| 729 |
|
|---|
| [9c1600c] | 730 | //--------------------------------------------------------------------------
|
|---|
| 731 | // SwitchStmt
|
|---|
| [13932f14] | 732 | template< typename pass_type >
|
|---|
| [ab904dc] | 733 | void PassVisitor< pass_type >::visit( SwitchStmt * node ) {
|
|---|
| [4551a6e] | 734 | VISIT_START( node );
|
|---|
| [9c1600c] | 735 |
|
|---|
| [e0886db] | 736 | visitExpression ( node->condition );
|
|---|
| 737 | visitStatementList( node->statements );
|
|---|
| [9c1600c] | 738 |
|
|---|
| 739 | VISIT_END( node );
|
|---|
| [13932f14] | 740 | }
|
|---|
| 741 |
|
|---|
| [296b2be] | 742 | template< typename pass_type >
|
|---|
| 743 | Statement * PassVisitor< pass_type >::mutate( SwitchStmt * node ) {
|
|---|
| [4551a6e] | 744 | MUTATE_START( node );
|
|---|
| 745 |
|
|---|
| [e0886db] | 746 | node->condition = mutateExpression( node->condition );
|
|---|
| 747 | mutateStatementList( node->statements );
|
|---|
| [4551a6e] | 748 |
|
|---|
| [296b2be] | 749 | MUTATE_END( Statement, node );
|
|---|
| 750 | }
|
|---|
| 751 |
|
|---|
| [9c1600c] | 752 | //--------------------------------------------------------------------------
|
|---|
| [35df560] | 753 | // CaseStmt
|
|---|
| [13932f14] | 754 | template< typename pass_type >
|
|---|
| [ab904dc] | 755 | void PassVisitor< pass_type >::visit( CaseStmt * node ) {
|
|---|
| [4551a6e] | 756 | VISIT_START( node );
|
|---|
| 757 |
|
|---|
| [e0886db] | 758 | visitExpression ( node->condition );
|
|---|
| 759 | visitStatementList( node->stmts );
|
|---|
| [4551a6e] | 760 |
|
|---|
| [9c1600c] | 761 | VISIT_END( node );
|
|---|
| [13932f14] | 762 | }
|
|---|
| 763 |
|
|---|
| [296b2be] | 764 | template< typename pass_type >
|
|---|
| 765 | Statement * PassVisitor< pass_type >::mutate( CaseStmt * node ) {
|
|---|
| [4551a6e] | 766 | MUTATE_START( node );
|
|---|
| 767 |
|
|---|
| [e0886db] | 768 | node->condition = mutateExpression( node->condition );
|
|---|
| 769 | mutateStatementList( node->stmts );
|
|---|
| [4551a6e] | 770 |
|
|---|
| [296b2be] | 771 | MUTATE_END( Statement, node );
|
|---|
| 772 | }
|
|---|
| 773 |
|
|---|
| [6ca154b] | 774 | //--------------------------------------------------------------------------
|
|---|
| 775 | // BranchStmt
|
|---|
| [13932f14] | 776 | template< typename pass_type >
|
|---|
| [ab904dc] | 777 | void PassVisitor< pass_type >::visit( BranchStmt * node ) {
|
|---|
| [4551a6e] | 778 | VISIT_BODY( node );
|
|---|
| [13932f14] | 779 | }
|
|---|
| 780 |
|
|---|
| [6ca154b] | 781 | template< typename pass_type >
|
|---|
| 782 | Statement * PassVisitor< pass_type >::mutate( BranchStmt * node ) {
|
|---|
| 783 | MUTATE_BODY( Statement, node );
|
|---|
| 784 | }
|
|---|
| 785 |
|
|---|
| [9c1600c] | 786 | //--------------------------------------------------------------------------
|
|---|
| 787 | // ReturnStmt
|
|---|
| [13932f14] | 788 | template< typename pass_type >
|
|---|
| [ab904dc] | 789 | void PassVisitor< pass_type >::visit( ReturnStmt * node ) {
|
|---|
| [9c1600c] | 790 | VISIT_START( node );
|
|---|
| 791 |
|
|---|
| [e0886db] | 792 | visitExpression( node->expr );
|
|---|
| [9c1600c] | 793 |
|
|---|
| 794 | VISIT_END( node );
|
|---|
| [13932f14] | 795 | }
|
|---|
| 796 |
|
|---|
| [296b2be] | 797 | template< typename pass_type >
|
|---|
| 798 | Statement * PassVisitor< pass_type >::mutate( ReturnStmt * node ) {
|
|---|
| 799 | MUTATE_START( node );
|
|---|
| 800 |
|
|---|
| [e0886db] | 801 | node->expr = mutateExpression( node->expr );
|
|---|
| [296b2be] | 802 |
|
|---|
| 803 | MUTATE_END( Statement, node );
|
|---|
| 804 | }
|
|---|
| 805 |
|
|---|
| [6e09f211] | 806 | //--------------------------------------------------------------------------
|
|---|
| 807 | // ThrowStmt
|
|---|
| 808 |
|
|---|
| 809 | template< typename pass_type >
|
|---|
| 810 | void PassVisitor< pass_type >::visit( ThrowStmt * node ) {
|
|---|
| 811 | VISIT_BODY( node );
|
|---|
| 812 | }
|
|---|
| 813 |
|
|---|
| 814 | template< typename pass_type >
|
|---|
| 815 | Statement * PassVisitor< pass_type >::mutate( ThrowStmt * node ) {
|
|---|
| 816 | MUTATE_BODY( Statement, node );
|
|---|
| 817 | }
|
|---|
| 818 |
|
|---|
| [9c1600c] | 819 | //--------------------------------------------------------------------------
|
|---|
| 820 | // TryStmt
|
|---|
| [13932f14] | 821 | template< typename pass_type >
|
|---|
| [ab904dc] | 822 | void PassVisitor< pass_type >::visit( TryStmt * node ) {
|
|---|
| [9c1600c] | 823 | VISIT_START( node );
|
|---|
| 824 |
|
|---|
| [e0886db] | 825 | maybeAccept( node->block , *this );
|
|---|
| [9dcb653] | 826 | maybeAccept( node->handlers , *this );
|
|---|
| [e0886db] | 827 | maybeAccept( node->finallyBlock, *this );
|
|---|
| [9c1600c] | 828 |
|
|---|
| 829 | VISIT_END( node );
|
|---|
| [13932f14] | 830 | }
|
|---|
| 831 |
|
|---|
| [296b2be] | 832 | template< typename pass_type >
|
|---|
| 833 | Statement * PassVisitor< pass_type >::mutate( TryStmt * node ) {
|
|---|
| 834 | MUTATE_START( node );
|
|---|
| 835 |
|
|---|
| [e0886db] | 836 | maybeMutateRef( node->block , *this );
|
|---|
| [9dcb653] | 837 | maybeMutateRef( node->handlers , *this );
|
|---|
| [e0886db] | 838 | maybeMutateRef( node->finallyBlock, *this );
|
|---|
| [4551a6e] | 839 |
|
|---|
| [296b2be] | 840 | MUTATE_END( Statement, node );
|
|---|
| 841 | }
|
|---|
| 842 |
|
|---|
| [9c1600c] | 843 | //--------------------------------------------------------------------------
|
|---|
| 844 | // CatchStmt
|
|---|
| [13932f14] | 845 | template< typename pass_type >
|
|---|
| [ab904dc] | 846 | void PassVisitor< pass_type >::visit( CatchStmt * node ) {
|
|---|
| [9c1600c] | 847 | VISIT_START( node );
|
|---|
| [e0886db] | 848 | {
|
|---|
| 849 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 850 | maybeAccept( node->decl, *this );
|
|---|
| 851 | node->cond = visitExpression( node->cond );
|
|---|
| 852 | node->body = visitStatement ( node->body );
|
|---|
| 853 | }
|
|---|
| [9c1600c] | 854 | VISIT_END( node );
|
|---|
| [13932f14] | 855 | }
|
|---|
| 856 |
|
|---|
| [296b2be] | 857 | template< typename pass_type >
|
|---|
| 858 | Statement * PassVisitor< pass_type >::mutate( CatchStmt * node ) {
|
|---|
| 859 | MUTATE_START( node );
|
|---|
| [e0886db] | 860 | {
|
|---|
| 861 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 862 | maybeMutateRef( node->decl, *this );
|
|---|
| 863 | node->cond = mutateExpression( node->cond );
|
|---|
| 864 | node->body = mutateStatement ( node->body );
|
|---|
| 865 | }
|
|---|
| [296b2be] | 866 | MUTATE_END( Statement, node );
|
|---|
| 867 | }
|
|---|
| 868 |
|
|---|
| [2065609] | 869 | //--------------------------------------------------------------------------
|
|---|
| 870 | // FinallyStmt
|
|---|
| [13932f14] | 871 | template< typename pass_type >
|
|---|
| [ab904dc] | 872 | void PassVisitor< pass_type >::visit( FinallyStmt * node ) {
|
|---|
| [4551a6e] | 873 | VISIT_BODY( node );
|
|---|
| [13932f14] | 874 | }
|
|---|
| 875 |
|
|---|
| [2065609] | 876 | template< typename pass_type >
|
|---|
| 877 | Statement * PassVisitor< pass_type >::mutate( FinallyStmt * node ) {
|
|---|
| 878 | MUTATE_BODY( Statement, node );
|
|---|
| 879 | }
|
|---|
| 880 |
|
|---|
| 881 | //--------------------------------------------------------------------------
|
|---|
| 882 | // WaitForStmt
|
|---|
| 883 | template< typename pass_type >
|
|---|
| 884 | void PassVisitor< pass_type >::visit( WaitForStmt * node ) {
|
|---|
| 885 | VISIT_BODY( node );
|
|---|
| 886 | }
|
|---|
| 887 |
|
|---|
| 888 | template< typename pass_type >
|
|---|
| 889 | Statement * PassVisitor< pass_type >::mutate( WaitForStmt * node ) {
|
|---|
| 890 | MUTATE_BODY( Statement, node );
|
|---|
| 891 | }
|
|---|
| 892 |
|
|---|
| 893 | //--------------------------------------------------------------------------
|
|---|
| 894 | // NullStmt
|
|---|
| [13932f14] | 895 | template< typename pass_type >
|
|---|
| [ab904dc] | 896 | void PassVisitor< pass_type >::visit( NullStmt * node ) {
|
|---|
| [4551a6e] | 897 | VISIT_BODY( node );
|
|---|
| [13932f14] | 898 | }
|
|---|
| 899 |
|
|---|
| [2065609] | 900 | template< typename pass_type >
|
|---|
| 901 | NullStmt * PassVisitor< pass_type >::mutate( NullStmt * node ) {
|
|---|
| 902 | MUTATE_BODY( NullStmt, node );
|
|---|
| 903 | }
|
|---|
| 904 |
|
|---|
| 905 | //--------------------------------------------------------------------------
|
|---|
| 906 | // DeclStmt
|
|---|
| [13932f14] | 907 | template< typename pass_type >
|
|---|
| [ab904dc] | 908 | void PassVisitor< pass_type >::visit( DeclStmt * node ) {
|
|---|
| [4551a6e] | 909 | VISIT_BODY( node );
|
|---|
| [13932f14] | 910 | }
|
|---|
| 911 |
|
|---|
| [2065609] | 912 | template< typename pass_type >
|
|---|
| 913 | Statement * PassVisitor< pass_type >::mutate( DeclStmt * node ) {
|
|---|
| 914 | MUTATE_BODY( Statement, node );
|
|---|
| 915 | }
|
|---|
| 916 |
|
|---|
| 917 | //--------------------------------------------------------------------------
|
|---|
| 918 | // ImplicitCtorDtorStmt
|
|---|
| [13932f14] | 919 | template< typename pass_type >
|
|---|
| [ab904dc] | 920 | void PassVisitor< pass_type >::visit( ImplicitCtorDtorStmt * node ) {
|
|---|
| [4551a6e] | 921 | VISIT_BODY( node );
|
|---|
| [13932f14] | 922 | }
|
|---|
| 923 |
|
|---|
| [2065609] | 924 | template< typename pass_type >
|
|---|
| 925 | Statement * PassVisitor< pass_type >::mutate( ImplicitCtorDtorStmt * node ) {
|
|---|
| 926 | MUTATE_BODY( Statement, node );
|
|---|
| 927 | }
|
|---|
| 928 |
|
|---|
| 929 | //--------------------------------------------------------------------------
|
|---|
| 930 | // ApplicationExpr
|
|---|
| [13932f14] | 931 | template< typename pass_type >
|
|---|
| [ab904dc] | 932 | void PassVisitor< pass_type >::visit( ApplicationExpr * node ) {
|
|---|
| [e0886db] | 933 | VISIT_START( node );
|
|---|
| 934 |
|
|---|
| 935 | indexerScopedAccept( node->result , *this );
|
|---|
| 936 | maybeAccept ( node->function, *this );
|
|---|
| [9dcb653] | 937 | maybeAccept ( node->args , *this );
|
|---|
| [e0886db] | 938 |
|
|---|
| 939 | VISIT_END( node );
|
|---|
| [13932f14] | 940 | }
|
|---|
| 941 |
|
|---|
| [2065609] | 942 | template< typename pass_type >
|
|---|
| 943 | Expression * PassVisitor< pass_type >::mutate( ApplicationExpr * node ) {
|
|---|
| [e0886db] | 944 | MUTATE_START( node );
|
|---|
| 945 |
|
|---|
| 946 | indexerScopedMutate( node->env , *this );
|
|---|
| 947 | indexerScopedMutate( node->result , *this );
|
|---|
| 948 | maybeMutateRef ( node->function, *this );
|
|---|
| [9dcb653] | 949 | maybeMutateRef ( node->args , *this );
|
|---|
| [e0886db] | 950 |
|
|---|
| 951 | MUTATE_END( Expression, node );
|
|---|
| [2065609] | 952 | }
|
|---|
| 953 |
|
|---|
| [9c1600c] | 954 | //--------------------------------------------------------------------------
|
|---|
| 955 | // UntypedExpr
|
|---|
| [13932f14] | 956 | template< typename pass_type >
|
|---|
| [ab904dc] | 957 | void PassVisitor< pass_type >::visit( UntypedExpr * node ) {
|
|---|
| [9c1600c] | 958 | VISIT_START( node );
|
|---|
| 959 |
|
|---|
| [2a7b3ca] | 960 | // maybeAccept( node->get_env(), *this );
|
|---|
| [e0886db] | 961 | indexerScopedAccept( node->result, *this );
|
|---|
| [2a7b3ca] | 962 |
|
|---|
| [e0886db] | 963 | for ( auto expr : node->args ) {
|
|---|
| [9c1600c] | 964 | visitExpression( expr );
|
|---|
| 965 | }
|
|---|
| 966 |
|
|---|
| 967 | VISIT_END( node );
|
|---|
| [13932f14] | 968 | }
|
|---|
| 969 |
|
|---|
| [296b2be] | 970 | template< typename pass_type >
|
|---|
| 971 | Expression * PassVisitor< pass_type >::mutate( UntypedExpr * node ) {
|
|---|
| 972 | MUTATE_START( node );
|
|---|
| 973 |
|
|---|
| [e0886db] | 974 | indexerScopedMutate( node->env , *this );
|
|---|
| 975 | indexerScopedMutate( node->result, *this );
|
|---|
| [2a7b3ca] | 976 |
|
|---|
| [e0886db] | 977 | for ( auto& expr : node->args ) {
|
|---|
| [296b2be] | 978 | expr = mutateExpression( expr );
|
|---|
| 979 | }
|
|---|
| 980 |
|
|---|
| 981 | MUTATE_END( Expression, node );
|
|---|
| 982 | }
|
|---|
| 983 |
|
|---|
| [e0886db] | 984 | //--------------------------------------------------------------------------
|
|---|
| 985 | // NameExpr
|
|---|
| [13932f14] | 986 | template< typename pass_type >
|
|---|
| [ab904dc] | 987 | void PassVisitor< pass_type >::visit( NameExpr * node ) {
|
|---|
| [e0886db] | 988 | VISIT_START( node );
|
|---|
| 989 |
|
|---|
| 990 | indexerScopedAccept( node->result, *this );
|
|---|
| 991 |
|
|---|
| 992 | VISIT_END( node );
|
|---|
| [13932f14] | 993 | }
|
|---|
| 994 |
|
|---|
| 995 | template< typename pass_type >
|
|---|
| [e0886db] | 996 | Expression * PassVisitor< pass_type >::mutate( NameExpr * node ) {
|
|---|
| 997 | MUTATE_START( node );
|
|---|
| 998 |
|
|---|
| 999 | indexerScopedMutate( node->env , *this );
|
|---|
| 1000 | indexerScopedMutate( node->result, *this );
|
|---|
| 1001 |
|
|---|
| 1002 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1003 | }
|
|---|
| 1004 |
|
|---|
| [e0886db] | 1005 | //--------------------------------------------------------------------------
|
|---|
| 1006 | // CastExpr
|
|---|
| [a5f0529] | 1007 | template< typename pass_type >
|
|---|
| [e0886db] | 1008 | void PassVisitor< pass_type >::visit( CastExpr * node ) {
|
|---|
| 1009 | VISIT_START( node );
|
|---|
| 1010 |
|
|---|
| 1011 | indexerScopedAccept( node->result, *this );
|
|---|
| 1012 | maybeAccept ( node->arg , *this );
|
|---|
| 1013 |
|
|---|
| 1014 | VISIT_END( node );
|
|---|
| [a5f0529] | 1015 | }
|
|---|
| 1016 |
|
|---|
| [13932f14] | 1017 | template< typename pass_type >
|
|---|
| [e0886db] | 1018 | Expression * PassVisitor< pass_type >::mutate( CastExpr * node ) {
|
|---|
| 1019 | MUTATE_START( node );
|
|---|
| 1020 |
|
|---|
| 1021 | indexerScopedMutate( node->env , *this );
|
|---|
| 1022 | indexerScopedMutate( node->result, *this );
|
|---|
| 1023 | maybeMutateRef ( node->arg , *this );
|
|---|
| 1024 |
|
|---|
| 1025 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1026 | }
|
|---|
| 1027 |
|
|---|
| [e0886db] | 1028 | //--------------------------------------------------------------------------
|
|---|
| 1029 | // VirtualCastExpr
|
|---|
| [13932f14] | 1030 | template< typename pass_type >
|
|---|
| [e0886db] | 1031 | void PassVisitor< pass_type >::visit( VirtualCastExpr * node ) {
|
|---|
| 1032 | VISIT_START( node );
|
|---|
| 1033 |
|
|---|
| 1034 | indexerScopedAccept( node->result, *this );
|
|---|
| 1035 | maybeAccept( node->arg, *this );
|
|---|
| 1036 |
|
|---|
| 1037 | VISIT_END( node );
|
|---|
| [13932f14] | 1038 | }
|
|---|
| 1039 |
|
|---|
| 1040 | template< typename pass_type >
|
|---|
| [e0886db] | 1041 | Expression * PassVisitor< pass_type >::mutate( VirtualCastExpr * node ) {
|
|---|
| 1042 | MUTATE_START( node );
|
|---|
| 1043 |
|
|---|
| 1044 | indexerScopedMutate( node->env , *this );
|
|---|
| 1045 | indexerScopedMutate( node->result, *this );
|
|---|
| 1046 | maybeMutateRef ( node->arg , *this );
|
|---|
| 1047 |
|
|---|
| 1048 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1049 | }
|
|---|
| 1050 |
|
|---|
| [e0886db] | 1051 | //--------------------------------------------------------------------------
|
|---|
| 1052 | // AddressExpr
|
|---|
| [13932f14] | 1053 | template< typename pass_type >
|
|---|
| [e0886db] | 1054 | void PassVisitor< pass_type >::visit( AddressExpr * node ) {
|
|---|
| 1055 | VISIT_START( node );
|
|---|
| 1056 |
|
|---|
| 1057 | indexerScopedAccept( node->result, *this );
|
|---|
| 1058 | maybeAccept ( node->arg , *this );
|
|---|
| 1059 |
|
|---|
| 1060 | VISIT_END( node );
|
|---|
| [13932f14] | 1061 | }
|
|---|
| 1062 |
|
|---|
| 1063 | template< typename pass_type >
|
|---|
| [e0886db] | 1064 | Expression * PassVisitor< pass_type >::mutate( AddressExpr * node ) {
|
|---|
| 1065 | MUTATE_START( node );
|
|---|
| 1066 |
|
|---|
| 1067 | indexerScopedMutate( node->env , *this );
|
|---|
| 1068 | indexerScopedMutate( node->result, *this );
|
|---|
| 1069 | maybeMutateRef ( node->arg , *this );
|
|---|
| 1070 |
|
|---|
| 1071 | MUTATE_END( Expression, node );
|
|---|
| 1072 | }
|
|---|
| 1073 |
|
|---|
| 1074 | //--------------------------------------------------------------------------
|
|---|
| 1075 | // LabelAddressExpr
|
|---|
| 1076 | template< typename pass_type >
|
|---|
| 1077 | void PassVisitor< pass_type >::visit( LabelAddressExpr * node ) {
|
|---|
| 1078 | VISIT_START( node );
|
|---|
| 1079 |
|
|---|
| 1080 | indexerScopedAccept( node->result, *this );
|
|---|
| 1081 |
|
|---|
| 1082 | VISIT_END( node );
|
|---|
| 1083 | }
|
|---|
| 1084 |
|
|---|
| 1085 | template< typename pass_type >
|
|---|
| 1086 | Expression * PassVisitor< pass_type >::mutate( LabelAddressExpr * node ) {
|
|---|
| 1087 | MUTATE_START( node );
|
|---|
| 1088 |
|
|---|
| 1089 | indexerScopedMutate( node->env , *this );
|
|---|
| 1090 | indexerScopedMutate( node->result, *this );
|
|---|
| 1091 |
|
|---|
| 1092 | MUTATE_END( Expression, node );
|
|---|
| 1093 | }
|
|---|
| 1094 |
|
|---|
| 1095 | //--------------------------------------------------------------------------
|
|---|
| 1096 | // UntypedMemberExpr
|
|---|
| 1097 | template< typename pass_type >
|
|---|
| 1098 | void PassVisitor< pass_type >::visit( UntypedMemberExpr * node ) {
|
|---|
| 1099 | VISIT_START( node );
|
|---|
| 1100 |
|
|---|
| 1101 | indexerScopedAccept( node->result , *this );
|
|---|
| 1102 | maybeAccept ( node->aggregate, *this );
|
|---|
| 1103 | maybeAccept ( node->member , *this );
|
|---|
| 1104 |
|
|---|
| 1105 | VISIT_END( node );
|
|---|
| [13932f14] | 1106 | }
|
|---|
| 1107 |
|
|---|
| [e0886db] | 1108 | template< typename pass_type >
|
|---|
| 1109 | Expression * PassVisitor< pass_type >::mutate( UntypedMemberExpr * node ) {
|
|---|
| 1110 | MUTATE_START( node );
|
|---|
| 1111 |
|
|---|
| 1112 | indexerScopedMutate( node->env , *this );
|
|---|
| 1113 | indexerScopedMutate( node->result , *this );
|
|---|
| 1114 | maybeMutateRef ( node->aggregate, *this );
|
|---|
| 1115 | maybeMutateRef ( node->member , *this );
|
|---|
| 1116 |
|
|---|
| 1117 | MUTATE_END( Expression, node );
|
|---|
| 1118 | }
|
|---|
| 1119 |
|
|---|
| 1120 | //--------------------------------------------------------------------------
|
|---|
| 1121 | // MemberExpr
|
|---|
| 1122 | template< typename pass_type >
|
|---|
| 1123 | void PassVisitor< pass_type >::visit( MemberExpr * node ) {
|
|---|
| 1124 | VISIT_START( node );
|
|---|
| 1125 |
|
|---|
| 1126 | indexerScopedAccept( node->result , *this );
|
|---|
| 1127 | maybeAccept ( node->aggregate, *this );
|
|---|
| 1128 |
|
|---|
| 1129 | VISIT_END( node );
|
|---|
| 1130 | }
|
|---|
| 1131 |
|
|---|
| 1132 | template< typename pass_type >
|
|---|
| 1133 | Expression * PassVisitor< pass_type >::mutate( MemberExpr * node ) {
|
|---|
| 1134 | MUTATE_START( node );
|
|---|
| 1135 |
|
|---|
| 1136 | indexerScopedMutate( node->env , *this );
|
|---|
| 1137 | indexerScopedMutate( node->result , *this );
|
|---|
| 1138 | maybeMutateRef ( node->aggregate, *this );
|
|---|
| 1139 |
|
|---|
| 1140 | MUTATE_END( Expression, node );
|
|---|
| 1141 | }
|
|---|
| 1142 |
|
|---|
| 1143 | //--------------------------------------------------------------------------
|
|---|
| 1144 | // VariableExpr
|
|---|
| 1145 | template< typename pass_type >
|
|---|
| 1146 | void PassVisitor< pass_type >::visit( VariableExpr * node ) {
|
|---|
| 1147 | VISIT_START( node );
|
|---|
| 1148 |
|
|---|
| 1149 | indexerScopedAccept( node->result, *this );
|
|---|
| 1150 |
|
|---|
| 1151 | VISIT_END( node );
|
|---|
| 1152 | }
|
|---|
| 1153 |
|
|---|
| 1154 | template< typename pass_type >
|
|---|
| 1155 | Expression * PassVisitor< pass_type >::mutate( VariableExpr * node ) {
|
|---|
| 1156 | MUTATE_START( node );
|
|---|
| 1157 |
|
|---|
| 1158 | indexerScopedMutate( node->env , *this );
|
|---|
| 1159 | indexerScopedMutate( node->result, *this );
|
|---|
| 1160 |
|
|---|
| 1161 | MUTATE_END( Expression, node );
|
|---|
| 1162 | }
|
|---|
| 1163 |
|
|---|
| 1164 | //--------------------------------------------------------------------------
|
|---|
| 1165 | // ConstantExpr
|
|---|
| [13932f14] | 1166 | template< typename pass_type >
|
|---|
| [ab904dc] | 1167 | void PassVisitor< pass_type >::visit( ConstantExpr * node ) {
|
|---|
| [e0886db] | 1168 | VISIT_START( node );
|
|---|
| 1169 |
|
|---|
| 1170 | indexerScopedAccept( node->result , *this );
|
|---|
| 1171 | maybeAccept ( &node->constant, *this );
|
|---|
| 1172 |
|
|---|
| 1173 | VISIT_END( node );
|
|---|
| [13932f14] | 1174 | }
|
|---|
| 1175 |
|
|---|
| [e0886db] | 1176 | template< typename pass_type >
|
|---|
| 1177 | Expression * PassVisitor< pass_type >::mutate( ConstantExpr * node ) {
|
|---|
| 1178 | MUTATE_START( node );
|
|---|
| 1179 |
|
|---|
| 1180 | indexerScopedMutate( node->env , *this );
|
|---|
| 1181 | indexerScopedMutate( node->result, *this );
|
|---|
| 1182 | node->constant = *maybeMutate( &node->constant, *this );
|
|---|
| 1183 |
|
|---|
| 1184 | MUTATE_END( Expression, node );
|
|---|
| 1185 | }
|
|---|
| 1186 |
|
|---|
| 1187 | //--------------------------------------------------------------------------
|
|---|
| 1188 | // SizeofExpr
|
|---|
| [13932f14] | 1189 | template< typename pass_type >
|
|---|
| [ab904dc] | 1190 | void PassVisitor< pass_type >::visit( SizeofExpr * node ) {
|
|---|
| [e0886db] | 1191 | VISIT_START( node );
|
|---|
| 1192 |
|
|---|
| 1193 | indexerScopedAccept( node->result, *this );
|
|---|
| 1194 | if ( node->get_isType() ) {
|
|---|
| 1195 | maybeAccept( node->type, *this );
|
|---|
| 1196 | } else {
|
|---|
| 1197 | maybeAccept( node->expr, *this );
|
|---|
| 1198 | }
|
|---|
| 1199 |
|
|---|
| 1200 | VISIT_END( node );
|
|---|
| [13932f14] | 1201 | }
|
|---|
| 1202 |
|
|---|
| [e0886db] | 1203 | template< typename pass_type >
|
|---|
| 1204 | Expression * PassVisitor< pass_type >::mutate( SizeofExpr * node ) {
|
|---|
| 1205 | MUTATE_START( node );
|
|---|
| 1206 |
|
|---|
| 1207 | indexerScopedMutate( node->env , *this );
|
|---|
| 1208 | indexerScopedMutate( node->result, *this );
|
|---|
| 1209 | if ( node->get_isType() ) {
|
|---|
| 1210 | maybeMutateRef( node->type, *this );
|
|---|
| 1211 | } else {
|
|---|
| 1212 | maybeMutateRef( node->expr, *this );
|
|---|
| 1213 | }
|
|---|
| 1214 |
|
|---|
| 1215 | MUTATE_END( Expression, node );
|
|---|
| 1216 | }
|
|---|
| 1217 |
|
|---|
| 1218 | //--------------------------------------------------------------------------
|
|---|
| 1219 | // AlignofExpr
|
|---|
| [13932f14] | 1220 | template< typename pass_type >
|
|---|
| [ab904dc] | 1221 | void PassVisitor< pass_type >::visit( AlignofExpr * node ) {
|
|---|
| [e0886db] | 1222 | VISIT_START( node );
|
|---|
| 1223 |
|
|---|
| 1224 | indexerScopedAccept( node->result, *this );
|
|---|
| 1225 | if ( node->get_isType() ) {
|
|---|
| 1226 | maybeAccept( node->type, *this );
|
|---|
| 1227 | } else {
|
|---|
| 1228 | maybeAccept( node->expr, *this );
|
|---|
| 1229 | }
|
|---|
| 1230 |
|
|---|
| 1231 | VISIT_END( node );
|
|---|
| [13932f14] | 1232 | }
|
|---|
| 1233 |
|
|---|
| [e0886db] | 1234 | template< typename pass_type >
|
|---|
| 1235 | Expression * PassVisitor< pass_type >::mutate( AlignofExpr * node ) {
|
|---|
| 1236 | MUTATE_START( node );
|
|---|
| 1237 |
|
|---|
| 1238 | indexerScopedMutate( node->env , *this );
|
|---|
| 1239 | indexerScopedMutate( node->result, *this );
|
|---|
| 1240 | if ( node->get_isType() ) {
|
|---|
| 1241 | maybeMutateRef( node->type, *this );
|
|---|
| 1242 | } else {
|
|---|
| 1243 | maybeMutateRef( node->expr, *this );
|
|---|
| 1244 | }
|
|---|
| 1245 |
|
|---|
| 1246 | MUTATE_END( Expression, node );
|
|---|
| 1247 | }
|
|---|
| 1248 |
|
|---|
| 1249 | //--------------------------------------------------------------------------
|
|---|
| 1250 | // UntypedOffsetofExpr
|
|---|
| [13932f14] | 1251 | template< typename pass_type >
|
|---|
| [ab904dc] | 1252 | void PassVisitor< pass_type >::visit( UntypedOffsetofExpr * node ) {
|
|---|
| [e0886db] | 1253 | VISIT_START( node );
|
|---|
| 1254 |
|
|---|
| 1255 | indexerScopedAccept( node->result, *this );
|
|---|
| 1256 | maybeAccept ( node->type , *this );
|
|---|
| 1257 |
|
|---|
| 1258 | VISIT_END( node );
|
|---|
| [13932f14] | 1259 | }
|
|---|
| 1260 |
|
|---|
| [e0886db] | 1261 | template< typename pass_type >
|
|---|
| 1262 | Expression * PassVisitor< pass_type >::mutate( UntypedOffsetofExpr * node ) {
|
|---|
| 1263 | MUTATE_START( node );
|
|---|
| 1264 |
|
|---|
| 1265 | indexerScopedMutate( node->env , *this );
|
|---|
| 1266 | indexerScopedMutate( node->result, *this );
|
|---|
| 1267 | maybeMutateRef ( node->type , *this );
|
|---|
| 1268 |
|
|---|
| 1269 | MUTATE_END( Expression, node );
|
|---|
| 1270 | }
|
|---|
| 1271 |
|
|---|
| 1272 | //--------------------------------------------------------------------------
|
|---|
| 1273 | // OffsetofExpr
|
|---|
| [13932f14] | 1274 | template< typename pass_type >
|
|---|
| [ab904dc] | 1275 | void PassVisitor< pass_type >::visit( OffsetofExpr * node ) {
|
|---|
| [e0886db] | 1276 | VISIT_START( node );
|
|---|
| 1277 |
|
|---|
| 1278 | indexerScopedAccept( node->result, *this );
|
|---|
| 1279 | maybeAccept ( node->type , *this );
|
|---|
| 1280 | maybeAccept ( node->member, *this );
|
|---|
| 1281 |
|
|---|
| 1282 | VISIT_END( node );
|
|---|
| [13932f14] | 1283 | }
|
|---|
| 1284 |
|
|---|
| [e0886db] | 1285 | template< typename pass_type >
|
|---|
| 1286 | Expression * PassVisitor< pass_type >::mutate( OffsetofExpr * node ) {
|
|---|
| 1287 | MUTATE_START( node );
|
|---|
| 1288 |
|
|---|
| 1289 | indexerScopedMutate( node->env , *this );
|
|---|
| 1290 | indexerScopedMutate( node->result, *this );
|
|---|
| 1291 | maybeMutateRef ( node->type , *this );
|
|---|
| 1292 | maybeMutateRef ( node->member, *this );
|
|---|
| 1293 |
|
|---|
| 1294 | MUTATE_END( Expression, node );
|
|---|
| 1295 | }
|
|---|
| 1296 |
|
|---|
| 1297 | //--------------------------------------------------------------------------
|
|---|
| 1298 | // OffsetPackExpr
|
|---|
| [13932f14] | 1299 | template< typename pass_type >
|
|---|
| [ab904dc] | 1300 | void PassVisitor< pass_type >::visit( OffsetPackExpr * node ) {
|
|---|
| [e0886db] | 1301 | VISIT_START( node );
|
|---|
| 1302 |
|
|---|
| 1303 | indexerScopedAccept( node->result, *this );
|
|---|
| 1304 | maybeAccept ( node->type , *this );
|
|---|
| 1305 |
|
|---|
| 1306 | VISIT_END( node );
|
|---|
| [13932f14] | 1307 | }
|
|---|
| 1308 |
|
|---|
| [e0886db] | 1309 | template< typename pass_type >
|
|---|
| 1310 | Expression * PassVisitor< pass_type >::mutate( OffsetPackExpr * node ) {
|
|---|
| 1311 | MUTATE_START( node );
|
|---|
| 1312 |
|
|---|
| 1313 | indexerScopedMutate( node->env , *this );
|
|---|
| 1314 | indexerScopedMutate( node->result, *this );
|
|---|
| 1315 | maybeMutateRef ( node->type , *this );
|
|---|
| 1316 |
|
|---|
| 1317 | MUTATE_END( Expression, node );
|
|---|
| 1318 | }
|
|---|
| 1319 |
|
|---|
| 1320 | //--------------------------------------------------------------------------
|
|---|
| 1321 | // AttrExpr
|
|---|
| [13932f14] | 1322 | template< typename pass_type >
|
|---|
| [ab904dc] | 1323 | void PassVisitor< pass_type >::visit( AttrExpr * node ) {
|
|---|
| [e0886db] | 1324 | VISIT_START( node );
|
|---|
| 1325 |
|
|---|
| 1326 | indexerScopedAccept( node->result, *this );
|
|---|
| 1327 | if ( node->get_isType() ) {
|
|---|
| 1328 | maybeAccept( node->type, *this );
|
|---|
| 1329 | } else {
|
|---|
| 1330 | maybeAccept( node->expr, *this );
|
|---|
| 1331 | }
|
|---|
| 1332 |
|
|---|
| 1333 | VISIT_END( node );
|
|---|
| 1334 | }
|
|---|
| 1335 |
|
|---|
| 1336 | template< typename pass_type >
|
|---|
| 1337 | Expression * PassVisitor< pass_type >::mutate( AttrExpr * node ) {
|
|---|
| 1338 | MUTATE_START( node );
|
|---|
| 1339 |
|
|---|
| 1340 | indexerScopedMutate( node->env , *this );
|
|---|
| 1341 | indexerScopedMutate( node->result, *this );
|
|---|
| 1342 | if ( node->get_isType() ) {
|
|---|
| 1343 | maybeMutateRef( node->type, *this );
|
|---|
| 1344 | } else {
|
|---|
| 1345 | maybeMutateRef( node->expr, *this );
|
|---|
| 1346 | }
|
|---|
| 1347 |
|
|---|
| 1348 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1349 | }
|
|---|
| 1350 |
|
|---|
| [e0886db] | 1351 | //--------------------------------------------------------------------------
|
|---|
| 1352 | // LogicalExpr
|
|---|
| [13932f14] | 1353 | template< typename pass_type >
|
|---|
| [ab904dc] | 1354 | void PassVisitor< pass_type >::visit( LogicalExpr * node ) {
|
|---|
| [e0886db] | 1355 | VISIT_START( node );
|
|---|
| 1356 |
|
|---|
| 1357 | indexerScopedAccept( node->result, *this );
|
|---|
| 1358 | maybeAccept ( node->arg1 , *this );
|
|---|
| 1359 | maybeAccept ( node->arg2 , *this );
|
|---|
| 1360 |
|
|---|
| 1361 | VISIT_END( node );
|
|---|
| 1362 | }
|
|---|
| 1363 |
|
|---|
| 1364 | template< typename pass_type >
|
|---|
| 1365 | Expression * PassVisitor< pass_type >::mutate( LogicalExpr * node ) {
|
|---|
| 1366 | MUTATE_START( node );
|
|---|
| 1367 |
|
|---|
| 1368 | indexerScopedMutate( node->env , *this );
|
|---|
| 1369 | indexerScopedMutate( node->result, *this );
|
|---|
| 1370 | maybeMutateRef ( node->arg1 , *this );
|
|---|
| 1371 | maybeMutateRef ( node->arg2 , *this );
|
|---|
| 1372 |
|
|---|
| 1373 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1374 | }
|
|---|
| 1375 |
|
|---|
| [e0886db] | 1376 | //--------------------------------------------------------------------------
|
|---|
| 1377 | // ConditionalExpr
|
|---|
| [13932f14] | 1378 | template< typename pass_type >
|
|---|
| [ab904dc] | 1379 | void PassVisitor< pass_type >::visit( ConditionalExpr * node ) {
|
|---|
| [e0886db] | 1380 | VISIT_START( node );
|
|---|
| 1381 |
|
|---|
| 1382 | indexerScopedAccept( node->result, *this );
|
|---|
| 1383 | maybeAccept ( node->arg1 , *this );
|
|---|
| 1384 | maybeAccept ( node->arg2 , *this );
|
|---|
| 1385 | maybeAccept ( node->arg3 , *this );
|
|---|
| 1386 |
|
|---|
| 1387 | VISIT_END( node );
|
|---|
| [13932f14] | 1388 | }
|
|---|
| 1389 |
|
|---|
| [e0886db] | 1390 | template< typename pass_type >
|
|---|
| 1391 | Expression * PassVisitor< pass_type >::mutate( ConditionalExpr * node ) {
|
|---|
| 1392 | MUTATE_START( node );
|
|---|
| 1393 |
|
|---|
| 1394 | indexerScopedMutate( node->env , *this );
|
|---|
| 1395 | indexerScopedMutate( node->result, *this );
|
|---|
| 1396 | maybeMutateRef ( node->arg1 , *this );
|
|---|
| 1397 | maybeMutateRef ( node->arg2 , *this );
|
|---|
| 1398 | maybeMutateRef ( node->arg3 , *this );
|
|---|
| 1399 |
|
|---|
| 1400 | MUTATE_END( Expression, node );
|
|---|
| 1401 | }
|
|---|
| 1402 |
|
|---|
| 1403 | //--------------------------------------------------------------------------
|
|---|
| 1404 | // CommaExpr
|
|---|
| [13932f14] | 1405 | template< typename pass_type >
|
|---|
| [ab904dc] | 1406 | void PassVisitor< pass_type >::visit( CommaExpr * node ) {
|
|---|
| [e0886db] | 1407 | VISIT_START( node );
|
|---|
| 1408 |
|
|---|
| 1409 | indexerScopedAccept( node->result, *this );
|
|---|
| 1410 | maybeAccept ( node->arg1 , *this );
|
|---|
| 1411 | maybeAccept ( node->arg2 , *this );
|
|---|
| 1412 |
|
|---|
| 1413 | VISIT_END( node );
|
|---|
| 1414 | }
|
|---|
| 1415 |
|
|---|
| 1416 | template< typename pass_type >
|
|---|
| 1417 | Expression * PassVisitor< pass_type >::mutate( CommaExpr * node ) {
|
|---|
| 1418 | MUTATE_START( node );
|
|---|
| 1419 |
|
|---|
| 1420 | indexerScopedMutate( node->env , *this );
|
|---|
| 1421 | indexerScopedMutate( node->result, *this );
|
|---|
| 1422 | maybeMutateRef ( node->arg1 , *this );
|
|---|
| 1423 | maybeMutateRef ( node->arg2 , *this );
|
|---|
| 1424 |
|
|---|
| 1425 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1426 | }
|
|---|
| 1427 |
|
|---|
| [e0886db] | 1428 | //--------------------------------------------------------------------------
|
|---|
| 1429 | // TypeExpr
|
|---|
| [13932f14] | 1430 | template< typename pass_type >
|
|---|
| [ab904dc] | 1431 | void PassVisitor< pass_type >::visit( TypeExpr * node ) {
|
|---|
| [e0886db] | 1432 | VISIT_START( node );
|
|---|
| 1433 |
|
|---|
| 1434 | indexerScopedAccept( node->result, *this );
|
|---|
| 1435 | maybeAccept ( node->type, *this );
|
|---|
| 1436 |
|
|---|
| 1437 | VISIT_END( node );
|
|---|
| [13932f14] | 1438 | }
|
|---|
| 1439 |
|
|---|
| [e0886db] | 1440 | template< typename pass_type >
|
|---|
| 1441 | Expression * PassVisitor< pass_type >::mutate( TypeExpr * node ) {
|
|---|
| 1442 | MUTATE_START( node );
|
|---|
| 1443 |
|
|---|
| 1444 | indexerScopedMutate( node->env , *this );
|
|---|
| 1445 | indexerScopedMutate( node->result, *this );
|
|---|
| 1446 | maybeMutateRef ( node->type , *this );
|
|---|
| 1447 |
|
|---|
| 1448 | MUTATE_END( Expression, node );
|
|---|
| 1449 | }
|
|---|
| 1450 |
|
|---|
| 1451 | //--------------------------------------------------------------------------
|
|---|
| 1452 | // AsmExpr
|
|---|
| [13932f14] | 1453 | template< typename pass_type >
|
|---|
| [ab904dc] | 1454 | void PassVisitor< pass_type >::visit( AsmExpr * node ) {
|
|---|
| [e0886db] | 1455 | VISIT_START( node );
|
|---|
| 1456 |
|
|---|
| 1457 | indexerScopedAccept( node->result , *this );
|
|---|
| 1458 | maybeAccept ( node->inout , *this );
|
|---|
| 1459 | maybeAccept ( node->constraint, *this );
|
|---|
| 1460 | maybeAccept ( node->operand , *this );
|
|---|
| 1461 |
|
|---|
| 1462 | VISIT_END( node );
|
|---|
| [13932f14] | 1463 | }
|
|---|
| 1464 |
|
|---|
| [e0886db] | 1465 | template< typename pass_type >
|
|---|
| 1466 | Expression * PassVisitor< pass_type >::mutate( AsmExpr * node ) {
|
|---|
| 1467 | MUTATE_START( node );
|
|---|
| 1468 |
|
|---|
| 1469 | indexerScopedMutate( node->env , *this );
|
|---|
| 1470 | indexerScopedMutate( node->result , *this );
|
|---|
| 1471 | maybeMutateRef ( node->inout , *this );
|
|---|
| 1472 | maybeMutateRef ( node->constraint, *this );
|
|---|
| 1473 | maybeMutateRef ( node->operand , *this );
|
|---|
| 1474 |
|
|---|
| 1475 | MUTATE_END( Expression, node );
|
|---|
| 1476 | }
|
|---|
| 1477 |
|
|---|
| 1478 | //--------------------------------------------------------------------------
|
|---|
| 1479 | // ImplicitCopyCtorExpr
|
|---|
| [13932f14] | 1480 | template< typename pass_type >
|
|---|
| [ab904dc] | 1481 | void PassVisitor< pass_type >::visit( ImplicitCopyCtorExpr * node ) {
|
|---|
| [e0886db] | 1482 | VISIT_START( node );
|
|---|
| 1483 |
|
|---|
| 1484 | indexerScopedAccept( node->result , *this );
|
|---|
| 1485 | maybeAccept ( node->callExpr , *this );
|
|---|
| [9dcb653] | 1486 | maybeAccept ( node->tempDecls , *this );
|
|---|
| 1487 | maybeAccept ( node->returnDecls, *this );
|
|---|
| 1488 | maybeAccept ( node->dtors , *this );
|
|---|
| [e0886db] | 1489 |
|
|---|
| 1490 | VISIT_END( node );
|
|---|
| 1491 | }
|
|---|
| 1492 |
|
|---|
| 1493 | template< typename pass_type >
|
|---|
| 1494 | Expression * PassVisitor< pass_type >::mutate( ImplicitCopyCtorExpr * node ) {
|
|---|
| 1495 | MUTATE_START( node );
|
|---|
| 1496 |
|
|---|
| 1497 | indexerScopedMutate( node->env , *this );
|
|---|
| 1498 | indexerScopedMutate( node->result , *this );
|
|---|
| 1499 | maybeMutateRef ( node->callExpr , *this );
|
|---|
| [9dcb653] | 1500 | maybeMutateRef ( node->tempDecls , *this );
|
|---|
| 1501 | maybeMutateRef ( node->returnDecls, *this );
|
|---|
| 1502 | maybeMutateRef ( node->dtors , *this );
|
|---|
| [e0886db] | 1503 |
|
|---|
| 1504 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1505 | }
|
|---|
| 1506 |
|
|---|
| [e0886db] | 1507 | //--------------------------------------------------------------------------
|
|---|
| 1508 | // ConstructorExpr
|
|---|
| [13932f14] | 1509 | template< typename pass_type >
|
|---|
| [ab904dc] | 1510 | void PassVisitor< pass_type >::visit( ConstructorExpr * node ) {
|
|---|
| [e0886db] | 1511 | VISIT_START( node );
|
|---|
| 1512 |
|
|---|
| 1513 | indexerScopedAccept( node->result , *this );
|
|---|
| 1514 | maybeAccept ( node->callExpr, *this );
|
|---|
| 1515 |
|
|---|
| 1516 | VISIT_END( node );
|
|---|
| 1517 | }
|
|---|
| 1518 |
|
|---|
| 1519 | template< typename pass_type >
|
|---|
| 1520 | Expression * PassVisitor< pass_type >::mutate( ConstructorExpr * node ) {
|
|---|
| 1521 | MUTATE_START( node );
|
|---|
| 1522 |
|
|---|
| 1523 | indexerScopedMutate( node->env , *this );
|
|---|
| 1524 | indexerScopedMutate( node->result , *this );
|
|---|
| 1525 | maybeMutateRef ( node->callExpr, *this );
|
|---|
| 1526 |
|
|---|
| 1527 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1528 | }
|
|---|
| 1529 |
|
|---|
| [e0886db] | 1530 | //--------------------------------------------------------------------------
|
|---|
| 1531 | // CompoundLiteralExpr
|
|---|
| [13932f14] | 1532 | template< typename pass_type >
|
|---|
| [ab904dc] | 1533 | void PassVisitor< pass_type >::visit( CompoundLiteralExpr * node ) {
|
|---|
| [e0886db] | 1534 | VISIT_START( node );
|
|---|
| 1535 |
|
|---|
| 1536 | indexerScopedAccept( node->result , *this );
|
|---|
| 1537 | maybeAccept ( node->initializer, *this );
|
|---|
| 1538 |
|
|---|
| 1539 | VISIT_END( node );
|
|---|
| [13932f14] | 1540 | }
|
|---|
| 1541 |
|
|---|
| [e0886db] | 1542 | template< typename pass_type >
|
|---|
| 1543 | Expression * PassVisitor< pass_type >::mutate( CompoundLiteralExpr * node ) {
|
|---|
| 1544 | MUTATE_START( node );
|
|---|
| 1545 |
|
|---|
| 1546 | indexerScopedMutate( node->env , *this );
|
|---|
| 1547 | indexerScopedMutate( node->result , *this );
|
|---|
| 1548 | maybeMutateRef ( node->initializer, *this );
|
|---|
| 1549 |
|
|---|
| 1550 | MUTATE_END( Expression, node );
|
|---|
| 1551 | }
|
|---|
| 1552 |
|
|---|
| 1553 | //--------------------------------------------------------------------------
|
|---|
| 1554 | // RangeExpr
|
|---|
| [13932f14] | 1555 | template< typename pass_type >
|
|---|
| [ab904dc] | 1556 | void PassVisitor< pass_type >::visit( RangeExpr * node ) {
|
|---|
| [e0886db] | 1557 | VISIT_START( node );
|
|---|
| 1558 |
|
|---|
| 1559 | indexerScopedAccept( node->result, *this );
|
|---|
| 1560 | maybeAccept ( node->low , *this );
|
|---|
| 1561 | maybeAccept ( node->high , *this );
|
|---|
| 1562 |
|
|---|
| 1563 | VISIT_END( node );
|
|---|
| [13932f14] | 1564 | }
|
|---|
| 1565 |
|
|---|
| [e0886db] | 1566 | template< typename pass_type >
|
|---|
| 1567 | Expression * PassVisitor< pass_type >::mutate( RangeExpr * node ) {
|
|---|
| 1568 | MUTATE_START( node );
|
|---|
| 1569 |
|
|---|
| 1570 | indexerScopedMutate( node->env , *this );
|
|---|
| 1571 | indexerScopedMutate( node->result, *this );
|
|---|
| 1572 | maybeMutateRef ( node->low , *this );
|
|---|
| 1573 | maybeMutateRef ( node->high , *this );
|
|---|
| 1574 |
|
|---|
| 1575 | MUTATE_END( Expression, node );
|
|---|
| 1576 | }
|
|---|
| 1577 |
|
|---|
| 1578 | //--------------------------------------------------------------------------
|
|---|
| 1579 | // UntypedTupleExpr
|
|---|
| [13932f14] | 1580 | template< typename pass_type >
|
|---|
| [ab904dc] | 1581 | void PassVisitor< pass_type >::visit( UntypedTupleExpr * node ) {
|
|---|
| [e0886db] | 1582 | VISIT_START( node );
|
|---|
| 1583 |
|
|---|
| 1584 | indexerScopedAccept( node->result, *this );
|
|---|
| [9dcb653] | 1585 | maybeAccept ( node->exprs , *this );
|
|---|
| [e0886db] | 1586 |
|
|---|
| 1587 | VISIT_END( node );
|
|---|
| 1588 | }
|
|---|
| 1589 |
|
|---|
| 1590 | template< typename pass_type >
|
|---|
| 1591 | Expression * PassVisitor< pass_type >::mutate( UntypedTupleExpr * node ) {
|
|---|
| 1592 | MUTATE_START( node );
|
|---|
| 1593 |
|
|---|
| 1594 | indexerScopedMutate( node->env , *this );
|
|---|
| 1595 | indexerScopedMutate( node->result, *this );
|
|---|
| [9dcb653] | 1596 | maybeMutateRef ( node->exprs , *this );
|
|---|
| [e0886db] | 1597 |
|
|---|
| 1598 | MUTATE_END( Expression, node );
|
|---|
| 1599 | }
|
|---|
| 1600 |
|
|---|
| 1601 | //--------------------------------------------------------------------------
|
|---|
| 1602 | // TupleExpr
|
|---|
| 1603 | template< typename pass_type >
|
|---|
| 1604 | void PassVisitor< pass_type >::visit( TupleExpr * node ) {
|
|---|
| 1605 | VISIT_START( node );
|
|---|
| 1606 |
|
|---|
| 1607 | indexerScopedAccept( node->result, *this );
|
|---|
| 1608 | maybeAccept ( node->exprs , *this );
|
|---|
| 1609 |
|
|---|
| 1610 | VISIT_END( node );
|
|---|
| 1611 | }
|
|---|
| 1612 |
|
|---|
| 1613 | template< typename pass_type >
|
|---|
| 1614 | Expression * PassVisitor< pass_type >::mutate( TupleExpr * node ) {
|
|---|
| 1615 | MUTATE_START( node );
|
|---|
| 1616 |
|
|---|
| 1617 | indexerScopedMutate( node->env , *this );
|
|---|
| 1618 | indexerScopedMutate( node->result, *this );
|
|---|
| [9dcb653] | 1619 | maybeMutateRef ( node->exprs , *this );
|
|---|
| [e0886db] | 1620 |
|
|---|
| 1621 | MUTATE_END( Expression, node );
|
|---|
| 1622 | }
|
|---|
| 1623 |
|
|---|
| 1624 | //--------------------------------------------------------------------------
|
|---|
| 1625 | // TupleIndexExpr
|
|---|
| 1626 | template< typename pass_type >
|
|---|
| 1627 | void PassVisitor< pass_type >::visit( TupleIndexExpr * node ) {
|
|---|
| 1628 | VISIT_START( node );
|
|---|
| 1629 |
|
|---|
| 1630 | indexerScopedAccept( node->result, *this );
|
|---|
| 1631 | maybeAccept ( node->tuple , *this );
|
|---|
| 1632 |
|
|---|
| 1633 | VISIT_END( node );
|
|---|
| 1634 | }
|
|---|
| 1635 |
|
|---|
| 1636 | template< typename pass_type >
|
|---|
| 1637 | Expression * PassVisitor< pass_type >::mutate( TupleIndexExpr * node ) {
|
|---|
| 1638 | MUTATE_START( node );
|
|---|
| 1639 |
|
|---|
| 1640 | indexerScopedMutate( node->env , *this );
|
|---|
| 1641 | indexerScopedMutate( node->result, *this );
|
|---|
| 1642 | maybeMutateRef ( node->tuple , *this );
|
|---|
| 1643 |
|
|---|
| 1644 | MUTATE_END( Expression, node );
|
|---|
| 1645 | }
|
|---|
| 1646 |
|
|---|
| 1647 | //--------------------------------------------------------------------------
|
|---|
| 1648 | // TupleAssignExpr
|
|---|
| 1649 | template< typename pass_type >
|
|---|
| 1650 | void PassVisitor< pass_type >::visit( TupleAssignExpr * node ) {
|
|---|
| 1651 | VISIT_START( node );
|
|---|
| 1652 |
|
|---|
| 1653 | indexerScopedAccept( node->result , *this );
|
|---|
| 1654 | maybeAccept ( node->stmtExpr, *this );
|
|---|
| 1655 |
|
|---|
| 1656 | VISIT_END( node );
|
|---|
| [13932f14] | 1657 | }
|
|---|
| 1658 |
|
|---|
| 1659 | template< typename pass_type >
|
|---|
| [e0886db] | 1660 | Expression * PassVisitor< pass_type >::mutate( TupleAssignExpr * node ) {
|
|---|
| 1661 | MUTATE_START( node );
|
|---|
| [13932f14] | 1662 |
|
|---|
| [e0886db] | 1663 | indexerScopedMutate( node->env , *this );
|
|---|
| 1664 | indexerScopedMutate( node->result , *this );
|
|---|
| 1665 | maybeMutateRef ( node->stmtExpr, *this );
|
|---|
| [13932f14] | 1666 |
|
|---|
| [e0886db] | 1667 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1668 | }
|
|---|
| 1669 |
|
|---|
| [9c1600c] | 1670 | //--------------------------------------------------------------------------
|
|---|
| [e0886db] | 1671 | // StmtExpr
|
|---|
| [13932f14] | 1672 | template< typename pass_type >
|
|---|
| [ab904dc] | 1673 | void PassVisitor< pass_type >::visit( StmtExpr * node ) {
|
|---|
| [9c1600c] | 1674 | VISIT_START( node );
|
|---|
| 1675 |
|
|---|
| 1676 | // don't want statements from outer CompoundStmts to be added to this StmtExpr
|
|---|
| 1677 | ValueGuardPtr< TypeSubstitution * > oldEnv ( get_env_ptr() );
|
|---|
| 1678 | ValueGuardPtr< std::list< Statement* > > oldBeforeStmts( get_beforeStmts() );
|
|---|
| 1679 | ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () );
|
|---|
| 1680 |
|
|---|
| [e0886db] | 1681 | indexerScopedAccept( node->result , *this );
|
|---|
| 1682 | maybeAccept ( node->statements , *this );
|
|---|
| [9dcb653] | 1683 | maybeAccept ( node->returnDecls, *this );
|
|---|
| 1684 | maybeAccept ( node->dtors , *this );
|
|---|
| [9c1600c] | 1685 |
|
|---|
| 1686 | VISIT_END( node );
|
|---|
| [13932f14] | 1687 | }
|
|---|
| 1688 |
|
|---|
| [296b2be] | 1689 | template< typename pass_type >
|
|---|
| 1690 | Expression * PassVisitor< pass_type >::mutate( StmtExpr * node ) {
|
|---|
| 1691 | MUTATE_START( node );
|
|---|
| [4551a6e] | 1692 |
|
|---|
| [296b2be] | 1693 | // don't want statements from outer CompoundStmts to be added to this StmtExpr
|
|---|
| [134322e] | 1694 | ValueGuardPtr< TypeSubstitution * > oldEnv ( get_env_ptr() );
|
|---|
| 1695 | ValueGuardPtr< std::list< Statement* > > oldBeforeStmts( get_beforeStmts() );
|
|---|
| 1696 | ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () );
|
|---|
| [296b2be] | 1697 |
|
|---|
| [e0886db] | 1698 | indexerScopedMutate( node->result , *this );
|
|---|
| 1699 | maybeMutateRef ( node->statements , *this );
|
|---|
| [9dcb653] | 1700 | maybeMutateRef ( node->returnDecls, *this );
|
|---|
| 1701 | maybeMutateRef ( node->dtors , *this );
|
|---|
| [296b2be] | 1702 |
|
|---|
| 1703 | MUTATE_END( Expression, node );
|
|---|
| 1704 | }
|
|---|
| 1705 |
|
|---|
| [e0886db] | 1706 | //--------------------------------------------------------------------------
|
|---|
| 1707 | // UniqueExpr
|
|---|
| [13932f14] | 1708 | template< typename pass_type >
|
|---|
| [ab904dc] | 1709 | void PassVisitor< pass_type >::visit( UniqueExpr * node ) {
|
|---|
| [e0886db] | 1710 | VISIT_START( node );
|
|---|
| 1711 |
|
|---|
| 1712 | indexerScopedAccept( node->result, *this );
|
|---|
| 1713 | maybeAccept ( node->expr , *this );
|
|---|
| 1714 |
|
|---|
| 1715 | VISIT_END( node );
|
|---|
| 1716 | }
|
|---|
| 1717 |
|
|---|
| 1718 | template< typename pass_type >
|
|---|
| 1719 | Expression * PassVisitor< pass_type >::mutate( UniqueExpr * node ) {
|
|---|
| 1720 | MUTATE_START( node );
|
|---|
| 1721 |
|
|---|
| 1722 | indexerScopedMutate( node->env , *this );
|
|---|
| 1723 | indexerScopedMutate( node->result, *this );
|
|---|
| 1724 | maybeMutateRef ( node->expr , *this );
|
|---|
| 1725 |
|
|---|
| 1726 | MUTATE_END( Expression, node );
|
|---|
| [13932f14] | 1727 | }
|
|---|
| 1728 |
|
|---|
| 1729 | template< typename pass_type >
|
|---|
| [ab904dc] | 1730 | void PassVisitor< pass_type >::visit( VoidType * node ) {
|
|---|
| [4551a6e] | 1731 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1732 | }
|
|---|
| 1733 |
|
|---|
| 1734 | template< typename pass_type >
|
|---|
| [ab904dc] | 1735 | void PassVisitor< pass_type >::visit( BasicType * node ) {
|
|---|
| [4551a6e] | 1736 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1737 | }
|
|---|
| 1738 |
|
|---|
| 1739 | template< typename pass_type >
|
|---|
| [ab904dc] | 1740 | void PassVisitor< pass_type >::visit( PointerType * node ) {
|
|---|
| [4551a6e] | 1741 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1742 | }
|
|---|
| 1743 |
|
|---|
| 1744 | template< typename pass_type >
|
|---|
| [ab904dc] | 1745 | void PassVisitor< pass_type >::visit( ArrayType * node ) {
|
|---|
| [4551a6e] | 1746 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1747 | }
|
|---|
| 1748 |
|
|---|
| [6b9b047] | 1749 | template< typename pass_type >
|
|---|
| 1750 | void PassVisitor< pass_type >::visit( ReferenceType * node ) {
|
|---|
| 1751 | VISIT_BODY( node );
|
|---|
| 1752 | }
|
|---|
| 1753 |
|
|---|
| [13932f14] | 1754 | template< typename pass_type >
|
|---|
| [ab904dc] | 1755 | void PassVisitor< pass_type >::visit( FunctionType * node ) {
|
|---|
| [4551a6e] | 1756 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1757 | }
|
|---|
| 1758 |
|
|---|
| [e0886db] | 1759 | //--------------------------------------------------------------------------
|
|---|
| 1760 | // StructInstType
|
|---|
| [13932f14] | 1761 | template< typename pass_type >
|
|---|
| [ab904dc] | 1762 | void PassVisitor< pass_type >::visit( StructInstType * node ) {
|
|---|
| [e0886db] | 1763 | VISIT_START( node );
|
|---|
| 1764 |
|
|---|
| 1765 | indexerAddStruct( node->name );
|
|---|
| 1766 |
|
|---|
| 1767 | {
|
|---|
| 1768 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 1769 | maybeAccept( node->forall , *this );
|
|---|
| 1770 | maybeAccept( node->parameters, *this );
|
|---|
| 1771 | }
|
|---|
| 1772 |
|
|---|
| 1773 | VISIT_END( node );
|
|---|
| 1774 | }
|
|---|
| 1775 |
|
|---|
| 1776 | template< typename pass_type >
|
|---|
| 1777 | Type * PassVisitor< pass_type >::mutate( StructInstType * node ) {
|
|---|
| 1778 | MUTATE_START( node );
|
|---|
| 1779 |
|
|---|
| 1780 | indexerAddStruct( node->name );
|
|---|
| 1781 |
|
|---|
| 1782 | {
|
|---|
| 1783 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 1784 | maybeMutateRef( node->forall , *this );
|
|---|
| 1785 | maybeMutateRef( node->parameters, *this );
|
|---|
| 1786 | }
|
|---|
| 1787 |
|
|---|
| 1788 | MUTATE_END( Type, node );
|
|---|
| [13932f14] | 1789 | }
|
|---|
| 1790 |
|
|---|
| [e0886db] | 1791 | //--------------------------------------------------------------------------
|
|---|
| 1792 | // UnionInstType
|
|---|
| [13932f14] | 1793 | template< typename pass_type >
|
|---|
| [ab904dc] | 1794 | void PassVisitor< pass_type >::visit( UnionInstType * node ) {
|
|---|
| [e0886db] | 1795 | VISIT_START( node );
|
|---|
| 1796 |
|
|---|
| 1797 | indexerAddStruct( node->name );
|
|---|
| 1798 |
|
|---|
| 1799 | {
|
|---|
| 1800 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 1801 | maybeAccept( node->forall , *this );
|
|---|
| 1802 | maybeAccept( node->parameters, *this );
|
|---|
| 1803 | }
|
|---|
| 1804 |
|
|---|
| 1805 | VISIT_END( node );
|
|---|
| 1806 | }
|
|---|
| 1807 |
|
|---|
| 1808 | template< typename pass_type >
|
|---|
| 1809 | Type * PassVisitor< pass_type >::mutate( UnionInstType * node ) {
|
|---|
| 1810 | MUTATE_START( node );
|
|---|
| 1811 |
|
|---|
| 1812 | indexerAddStruct( node->name );
|
|---|
| 1813 |
|
|---|
| 1814 | {
|
|---|
| 1815 | auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
|
|---|
| 1816 | maybeMutateRef( node->forall , *this );
|
|---|
| 1817 | maybeMutateRef( node->parameters, *this );
|
|---|
| 1818 | }
|
|---|
| 1819 |
|
|---|
| 1820 | MUTATE_END( Type, node );
|
|---|
| [13932f14] | 1821 | }
|
|---|
| 1822 |
|
|---|
| [e0886db] | 1823 | //--------------------------------------------------------------------------
|
|---|
| 1824 | // EnumInstType
|
|---|
| [13932f14] | 1825 | template< typename pass_type >
|
|---|
| [ab904dc] | 1826 | void PassVisitor< pass_type >::visit( EnumInstType * node ) {
|
|---|
| [4551a6e] | 1827 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1828 | }
|
|---|
| 1829 |
|
|---|
| [e0886db] | 1830 | template< typename pass_type >
|
|---|
| 1831 | Type * PassVisitor< pass_type >::mutate( EnumInstType * node ) {
|
|---|
| 1832 | MUTATE_BODY( Type, node );
|
|---|
| 1833 | }
|
|---|
| 1834 |
|
|---|
| 1835 | //--------------------------------------------------------------------------
|
|---|
| 1836 | // TraitInstType
|
|---|
| [13932f14] | 1837 | template< typename pass_type >
|
|---|
| [ab904dc] | 1838 | void PassVisitor< pass_type >::visit( TraitInstType * node ) {
|
|---|
| [e0886db] | 1839 | VISIT_START( node );
|
|---|
| 1840 |
|
|---|
| 1841 | maybeAccept( node->forall , *this );
|
|---|
| 1842 | maybeAccept( node->parameters, *this );
|
|---|
| 1843 |
|
|---|
| 1844 | VISIT_END( node );
|
|---|
| 1845 | }
|
|---|
| 1846 |
|
|---|
| 1847 | template< typename pass_type >
|
|---|
| 1848 | Type * PassVisitor< pass_type >::mutate( TraitInstType * node ) {
|
|---|
| 1849 | MUTATE_START( node );
|
|---|
| 1850 |
|
|---|
| 1851 | maybeMutateRef( node->forall , *this );
|
|---|
| 1852 | maybeMutateRef( node->parameters, *this );
|
|---|
| 1853 |
|
|---|
| 1854 | MUTATE_END( Type, node );
|
|---|
| [13932f14] | 1855 | }
|
|---|
| 1856 |
|
|---|
| [e0886db] | 1857 | //--------------------------------------------------------------------------
|
|---|
| 1858 | // TypeInstType
|
|---|
| [13932f14] | 1859 | template< typename pass_type >
|
|---|
| [ab904dc] | 1860 | void PassVisitor< pass_type >::visit( TypeInstType * node ) {
|
|---|
| [4551a6e] | 1861 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1862 | }
|
|---|
| 1863 |
|
|---|
| 1864 | template< typename pass_type >
|
|---|
| [ab904dc] | 1865 | void PassVisitor< pass_type >::visit( TupleType * node ) {
|
|---|
| [4551a6e] | 1866 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1867 | }
|
|---|
| 1868 |
|
|---|
| 1869 | template< typename pass_type >
|
|---|
| [ab904dc] | 1870 | void PassVisitor< pass_type >::visit( TypeofType * node ) {
|
|---|
| [4551a6e] | 1871 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1872 | }
|
|---|
| 1873 |
|
|---|
| 1874 | template< typename pass_type >
|
|---|
| [ab904dc] | 1875 | void PassVisitor< pass_type >::visit( AttrType * node ) {
|
|---|
| [4551a6e] | 1876 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1877 | }
|
|---|
| 1878 |
|
|---|
| 1879 | template< typename pass_type >
|
|---|
| [ab904dc] | 1880 | void PassVisitor< pass_type >::visit( VarArgsType * node ) {
|
|---|
| [4551a6e] | 1881 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1882 | }
|
|---|
| 1883 |
|
|---|
| 1884 | template< typename pass_type >
|
|---|
| [ab904dc] | 1885 | void PassVisitor< pass_type >::visit( ZeroType * node ) {
|
|---|
| [4551a6e] | 1886 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1887 | }
|
|---|
| 1888 |
|
|---|
| 1889 | template< typename pass_type >
|
|---|
| [ab904dc] | 1890 | void PassVisitor< pass_type >::visit( OneType * node ) {
|
|---|
| [4551a6e] | 1891 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1892 | }
|
|---|
| 1893 |
|
|---|
| [9c1600c] | 1894 | //--------------------------------------------------------------------------
|
|---|
| [e0886db] | 1895 | // SingleInit
|
|---|
| [13932f14] | 1896 | template< typename pass_type >
|
|---|
| [ab904dc] | 1897 | void PassVisitor< pass_type >::visit( SingleInit * node ) {
|
|---|
| [9c1600c] | 1898 | VISIT_START( node );
|
|---|
| 1899 |
|
|---|
| 1900 | visitExpression( node->get_value() );
|
|---|
| 1901 |
|
|---|
| 1902 | VISIT_END( node );
|
|---|
| [13932f14] | 1903 | }
|
|---|
| 1904 |
|
|---|
| [296b2be] | 1905 | template< typename pass_type >
|
|---|
| 1906 | Initializer * PassVisitor< pass_type >::mutate( SingleInit * node ) {
|
|---|
| 1907 | MUTATE_START( node );
|
|---|
| 1908 |
|
|---|
| 1909 | node->set_value( mutateExpression( node->get_value() ) );
|
|---|
| 1910 |
|
|---|
| 1911 | MUTATE_END( Initializer, node );
|
|---|
| 1912 | }
|
|---|
| 1913 |
|
|---|
| [13932f14] | 1914 | template< typename pass_type >
|
|---|
| [ab904dc] | 1915 | void PassVisitor< pass_type >::visit( ListInit * node ) {
|
|---|
| [4551a6e] | 1916 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1917 | }
|
|---|
| 1918 |
|
|---|
| 1919 | template< typename pass_type >
|
|---|
| [ab904dc] | 1920 | void PassVisitor< pass_type >::visit( ConstructorInit * node ) {
|
|---|
| [4551a6e] | 1921 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1922 | }
|
|---|
| 1923 |
|
|---|
| 1924 | template< typename pass_type >
|
|---|
| [ab904dc] | 1925 | void PassVisitor< pass_type >::visit( Subrange * node ) {
|
|---|
| [4551a6e] | 1926 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1927 | }
|
|---|
| 1928 |
|
|---|
| 1929 | template< typename pass_type >
|
|---|
| [ab904dc] | 1930 | void PassVisitor< pass_type >::visit( Constant * node ) {
|
|---|
| [4551a6e] | 1931 | VISIT_BODY( node );
|
|---|
| [13932f14] | 1932 | }
|
|---|
| [ab904dc] | 1933 |
|
|---|
| 1934 | //---------------------------------------------------------------------------------------------------------------
|
|---|
| 1935 | template< typename pass_type >
|
|---|
| 1936 | Type * PassVisitor< pass_type >::mutate( VoidType * node ) {
|
|---|
| 1937 | MUTATE_BODY( Type, node );
|
|---|
| 1938 | }
|
|---|
| 1939 |
|
|---|
| 1940 | template< typename pass_type >
|
|---|
| 1941 | Type * PassVisitor< pass_type >::mutate( BasicType * node ) {
|
|---|
| 1942 | MUTATE_BODY( Type, node );
|
|---|
| 1943 | }
|
|---|
| 1944 |
|
|---|
| 1945 | template< typename pass_type >
|
|---|
| 1946 | Type * PassVisitor< pass_type >::mutate( PointerType * node ) {
|
|---|
| 1947 | MUTATE_BODY( Type, node );
|
|---|
| 1948 | }
|
|---|
| 1949 |
|
|---|
| 1950 | template< typename pass_type >
|
|---|
| 1951 | Type * PassVisitor< pass_type >::mutate( ArrayType * node ) {
|
|---|
| 1952 | MUTATE_BODY( Type, node );
|
|---|
| 1953 | }
|
|---|
| 1954 |
|
|---|
| 1955 | template< typename pass_type >
|
|---|
| [6b9b047] | 1956 | Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {
|
|---|
| 1957 | MUTATE_BODY( Type, node );
|
|---|
| 1958 | }
|
|---|
| 1959 |
|
|---|
| 1960 | template< typename pass_type >
|
|---|
| [ab904dc] | 1961 | Type * PassVisitor< pass_type >::mutate( FunctionType * node ) {
|
|---|
| 1962 | MUTATE_BODY( Type, node );
|
|---|
| 1963 | }
|
|---|
| 1964 |
|
|---|
| 1965 | template< typename pass_type >
|
|---|
| 1966 | Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) {
|
|---|
| 1967 | MUTATE_BODY( Type, node );
|
|---|
| 1968 | }
|
|---|
| 1969 |
|
|---|
| 1970 | template< typename pass_type >
|
|---|
| 1971 | Type * PassVisitor< pass_type >::mutate( TupleType * node ) {
|
|---|
| 1972 | MUTATE_BODY( Type, node );
|
|---|
| 1973 | }
|
|---|
| 1974 |
|
|---|
| 1975 | template< typename pass_type >
|
|---|
| 1976 | Type * PassVisitor< pass_type >::mutate( TypeofType * node ) {
|
|---|
| 1977 | MUTATE_BODY( Type, node );
|
|---|
| 1978 | }
|
|---|
| 1979 |
|
|---|
| 1980 | template< typename pass_type >
|
|---|
| 1981 | Type * PassVisitor< pass_type >::mutate( AttrType * node ) {
|
|---|
| 1982 | MUTATE_BODY( Type, node );
|
|---|
| 1983 | }
|
|---|
| 1984 |
|
|---|
| 1985 | template< typename pass_type >
|
|---|
| 1986 | Type * PassVisitor< pass_type >::mutate( VarArgsType * node ) {
|
|---|
| 1987 | MUTATE_BODY( Type, node );
|
|---|
| 1988 | }
|
|---|
| 1989 |
|
|---|
| 1990 | template< typename pass_type >
|
|---|
| 1991 | Type * PassVisitor< pass_type >::mutate( ZeroType * node ) {
|
|---|
| 1992 | MUTATE_BODY( Type, node );
|
|---|
| 1993 | }
|
|---|
| 1994 |
|
|---|
| 1995 | template< typename pass_type >
|
|---|
| 1996 | Type * PassVisitor< pass_type >::mutate( OneType * node ) {
|
|---|
| 1997 | MUTATE_BODY( Type, node );
|
|---|
| 1998 | }
|
|---|
| 1999 |
|
|---|
| 2000 | template< typename pass_type >
|
|---|
| 2001 | Initializer * PassVisitor< pass_type >::mutate( ListInit * node ) {
|
|---|
| 2002 | MUTATE_BODY( Initializer, node );
|
|---|
| 2003 | }
|
|---|
| 2004 |
|
|---|
| 2005 | template< typename pass_type >
|
|---|
| 2006 | Initializer * PassVisitor< pass_type >::mutate( ConstructorInit * node ) {
|
|---|
| 2007 | MUTATE_BODY( Initializer, node );
|
|---|
| 2008 | }
|
|---|
| 2009 |
|
|---|
| 2010 | template< typename pass_type >
|
|---|
| 2011 | Subrange * PassVisitor< pass_type >::mutate( Subrange * node ) {
|
|---|
| 2012 | MUTATE_BODY( Subrange, node );
|
|---|
| 2013 | }
|
|---|
| 2014 |
|
|---|
| 2015 | template< typename pass_type >
|
|---|
| 2016 | Constant * PassVisitor< pass_type >::mutate( Constant * node ) {
|
|---|
| 2017 | MUTATE_BODY( Constant, node );
|
|---|
| [4551a6e] | 2018 | }
|
|---|