Changes in src/Common/PassVisitor.impl.h [09a1ae6:9a705dc8]
- File:
-
- 1 edited
-
src/Common/PassVisitor.impl.h (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.impl.h
r09a1ae6 r9a705dc8 38 38 MUTATE_END( type, node ); \ 39 39 40 #include "Common/GC.h" 40 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 = new_static_root<ObjectDecl>(399 static ObjectDecl func( 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 = new_static_root<ObjectDecl>(429 static ObjectDecl func( 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 // StaticAssertDecl 688 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 ); 684 706 } 685 707 … … 1171 1193 indexerScopedAccept( node->result, *this ); 1172 1194 1173 // xxx - not quite sure why this doesn't visit( node->function );1174 1195 for ( auto expr : node->args ) { 1175 1196 visitExpression( expr ); … … 1228 1249 template< typename pass_type > 1229 1250 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 // KeywordCastExpr 1262 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 ) { 1230 1274 MUTATE_START( node ); 1231 1275 … … 1491 1535 indexerScopedAccept( node->result, *this ); 1492 1536 maybeAccept_impl ( node->type , *this ); 1493 maybeAccept_impl ( node->member, *this );1494 1537 1495 1538 VISIT_END( node ); … … 1503 1546 indexerScopedMutate( node->result, *this ); 1504 1547 maybeMutate_impl ( node->type , *this ); 1505 maybeMutate_impl ( node->member, *this );1506 1548 1507 1549 MUTATE_END( Expression, node ); … … 2557 2599 // TypeSubstitution 2558 2600 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 >2573 2601 TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) { 2574 2602 MUTATE_START( node );
Note:
See TracChangeset
for help on using the changeset viewer.