Changes in src/Common/PassVisitor.impl.h [9a705dc8:09a1ae6]
- File:
-
- 1 edited
-
src/Common/PassVisitor.impl.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.impl.h
r9a705dc8 r09a1ae6 38 38 MUTATE_END( type, node ); \ 39 39 40 40 #include "Common/GC.h" 41 41 42 42 template<typename T> … … 397 397 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 398 398 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 399 static ObjectDecl func(399 static ObjectDecl* func = new_static_root<ObjectDecl>( 400 400 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 401 401 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 402 402 nullptr 403 403 ); 404 indexerAddId( &func );404 indexerAddId( func ); 405 405 maybeAccept_impl( node->type, *this ); 406 406 maybeAccept_impl( node->statements, *this ); … … 427 427 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 428 428 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 429 static ObjectDecl func(429 static ObjectDecl* func = new_static_root<ObjectDecl>( 430 430 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 431 431 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 432 432 nullptr 433 433 ); 434 indexerAddId( &func );434 indexerAddId( func ); 435 435 maybeMutate_impl( node->type, *this ); 436 436 maybeMutate_impl( node->statements, *this ); … … 682 682 683 683 MUTATE_END( AsmDecl, node ); 684 }685 686 //--------------------------------------------------------------------------687 // StaticAssertDecl688 template< typename pass_type >689 void PassVisitor< pass_type >::visit( StaticAssertDecl * node ) {690 VISIT_START( node );691 692 maybeAccept_impl( node->condition, *this );693 maybeAccept_impl( node->message , *this );694 695 VISIT_END( node );696 }697 698 template< typename pass_type >699 StaticAssertDecl * PassVisitor< pass_type >::mutate( StaticAssertDecl * node ) {700 MUTATE_START( node );701 702 maybeMutate_impl( node->condition, *this );703 maybeMutate_impl( node->message , *this );704 705 MUTATE_END( StaticAssertDecl, node );706 684 } 707 685 … … 1193 1171 indexerScopedAccept( node->result, *this ); 1194 1172 1173 // xxx - not quite sure why this doesn't visit( node->function ); 1195 1174 for ( auto expr : node->args ) { 1196 1175 visitExpression( expr ); … … 1249 1228 template< typename pass_type > 1250 1229 Expression * PassVisitor< pass_type >::mutate( CastExpr * node ) { 1251 MUTATE_START( node );1252 1253 indexerScopedMutate( node->env , *this );1254 indexerScopedMutate( node->result, *this );1255 maybeMutate_impl ( node->arg , *this );1256 1257 MUTATE_END( Expression, node );1258 }1259 1260 //--------------------------------------------------------------------------1261 // KeywordCastExpr1262 template< typename pass_type >1263 void PassVisitor< pass_type >::visit( KeywordCastExpr * node ) {1264 VISIT_START( node );1265 1266 indexerScopedAccept( node->result, *this );1267 maybeAccept_impl ( node->arg , *this );1268 1269 VISIT_END( node );1270 }1271 1272 template< typename pass_type >1273 Expression * PassVisitor< pass_type >::mutate( KeywordCastExpr * node ) {1274 1230 MUTATE_START( node ); 1275 1231 … … 1535 1491 indexerScopedAccept( node->result, *this ); 1536 1492 maybeAccept_impl ( node->type , *this ); 1493 maybeAccept_impl ( node->member, *this ); 1537 1494 1538 1495 VISIT_END( node ); … … 1546 1503 indexerScopedMutate( node->result, *this ); 1547 1504 maybeMutate_impl ( node->type , *this ); 1505 maybeMutate_impl ( node->member, *this ); 1548 1506 1549 1507 MUTATE_END( Expression, node ); … … 2599 2557 // TypeSubstitution 2600 2558 template< typename pass_type > 2559 void PassVisitor< pass_type >::visit( TypeSubstitution * node ) { 2560 VISIT_START( node ); 2561 2562 for ( auto & p : node->typeEnv ) { 2563 indexerScopedAccept( p.second, *this ); 2564 } 2565 for ( auto & p : node->varEnv ) { 2566 indexerScopedAccept( p.second, *this ); 2567 } 2568 2569 VISIT_END( node ); 2570 } 2571 2572 template< typename pass_type > 2601 2573 TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) { 2602 2574 MUTATE_START( node );
Note:
See TracChangeset
for help on using the changeset viewer.