Changes in src/Common/PassVisitor.impl.h [bc6f918:73367a8]
- File:
-
- 1 edited
-
src/Common/PassVisitor.impl.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Common/PassVisitor.impl.h
rbc6f918 r73367a8 365 365 maybeAccept_impl ( node->attributes , *this ); 366 366 367 indexerAddId( node ); 367 if ( node->name != "" ) { 368 indexerAddId( node ); 369 } 368 370 369 371 VISIT_END( node ); … … 379 381 maybeMutate_impl ( node->attributes , *this ); 380 382 381 indexerAddId( node ); 383 if ( node->name != "" ) { 384 indexerAddId( node ); 385 } 382 386 383 387 MUTATE_END( DeclarationWithType, node ); … … 390 394 VISIT_START( node ); 391 395 392 indexerAddId( node ); 393 394 maybeAccept_impl( node->withExprs, *this ); 395 { 396 // with clause introduces a level of scope (for the with expression members). 397 // with clause exprs are added to the indexer before parameters so that parameters 398 // shadow with exprs and not the other way around. 399 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 400 indexerAddWith( node->withExprs ); 401 { 402 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 403 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 404 static ObjectDecl func( 405 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 406 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 407 nullptr 408 ); 409 indexerAddId( &func ); 410 maybeAccept_impl( node->type, *this ); 411 maybeAccept_impl( node->statements, *this ); 412 maybeAccept_impl( node->attributes, *this ); 413 } 396 if ( node->name != "" ) { 397 indexerAddId( node ); 398 } 399 400 { 401 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 402 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 403 static ObjectDecl func( 404 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 405 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 406 nullptr 407 ); 408 indexerAddId( &func ); 409 maybeAccept_impl( node->type, *this ); 410 maybeAccept_impl( node->statements, *this ); 411 maybeAccept_impl( node->attributes, *this ); 414 412 } 415 413 … … 421 419 MUTATE_START( node ); 422 420 423 indexerAddId( node ); 424 425 { 426 // with clause introduces a level of scope (for the with expression members). 427 // with clause exprs are added to the indexer before parameters so that parameters 428 // shadow with exprs and not the other way around. 429 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 430 indexerAddWith( node->withExprs ); 431 { 432 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 433 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 434 static ObjectDecl func( 435 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 436 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 437 nullptr 438 ); 439 indexerAddId( &func ); 440 maybeMutate_impl( node->type, *this ); 441 maybeMutate_impl( node->statements, *this ); 442 maybeMutate_impl( node->attributes, *this ); 443 } 421 if ( node->name != "" ) { 422 indexerAddId( node ); 423 } 424 425 { 426 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 427 // implicit add __func__ identifier as specified in the C manual 6.4.2.2 428 static ObjectDecl func( 429 "__func__", noStorageClasses, LinkageSpec::C, nullptr, 430 new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ), 431 nullptr 432 ); 433 indexerAddId( &func ); 434 maybeMutate_impl( node->type, *this ); 435 maybeMutate_impl( node->statements, *this ); 436 maybeMutate_impl( node->attributes, *this ); 444 437 } 445 438 … … 737 730 template< typename pass_type > 738 731 void PassVisitor< pass_type >::visit( AsmStmt * node ) { 739 VISIT_START( node ) 740 741 maybeAccept_impl( node->instruction, *this ); 742 maybeAccept_impl( node->output, *this ); 743 maybeAccept_impl( node->input, *this ); 744 maybeAccept_impl( node->clobber, *this ); 745 746 VISIT_END( node ); 732 VISIT_BODY( node ); 747 733 } 748 734 749 735 template< typename pass_type > 750 736 Statement * PassVisitor< pass_type >::mutate( AsmStmt * node ) { 751 MUTATE_START( node ); 752 753 maybeMutate_impl( node->instruction, *this ); 754 maybeMutate_impl( node->output, *this ); 755 maybeMutate_impl( node->input, *this ); 756 maybeMutate_impl( node->clobber, *this ); 757 758 MUTATE_END( Statement, node ); 737 MUTATE_BODY( Statement, node ); 759 738 } 760 739 … … 1017 996 // catch statements introduce a level of scope (for the caught exception) 1018 997 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1019 indexerAddWith( node ->exprs);998 indexerAddWith( node ); 1020 999 maybeAccept_impl( node->stmt, *this ); 1021 1000 } … … 1030 1009 // catch statements introduce a level of scope (for the caught exception) 1031 1010 auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } ); 1032 indexerAddWith( node ->exprs);1011 indexerAddWith( node ); 1033 1012 maybeMutate_impl( node->stmt, *this ); 1034 1013 }
Note:
See TracChangeset
for help on using the changeset viewer.