Ignore:
File:
1 edited

Legend:

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

    r09a1ae6 r9a705dc8  
    3838        MUTATE_END( type, node );      \
    3939
    40 #include "Common/GC.h"
     40
    4141
    4242template<typename T>
     
    397397                        auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    398398                        // 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(
    400400                                "__func__", noStorageClasses, LinkageSpec::C, nullptr,
    401401                                new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
    402402                                nullptr
    403403                        );
    404                         indexerAddId( func );
     404                        indexerAddId( &func );
    405405                        maybeAccept_impl( node->type, *this );
    406406                        maybeAccept_impl( node->statements, *this );
     
    427427                        auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    428428                        // 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(
    430430                                "__func__", noStorageClasses, LinkageSpec::C, nullptr,
    431431                                new ArrayType( Type::Qualifiers(), new BasicType( Type::Qualifiers( Type::Const ), BasicType::Char ), nullptr, true, false ),
    432432                                nullptr
    433433                        );
    434                         indexerAddId( func );
     434                        indexerAddId( &func );
    435435                        maybeMutate_impl( node->type, *this );
    436436                        maybeMutate_impl( node->statements, *this );
     
    682682
    683683        MUTATE_END( AsmDecl, node );
     684}
     685
     686//--------------------------------------------------------------------------
     687// StaticAssertDecl
     688template< typename pass_type >
     689void 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
     698template< typename pass_type >
     699StaticAssertDecl * 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 );
    684706}
    685707
     
    11711193        indexerScopedAccept( node->result, *this );
    11721194
    1173         // xxx - not quite sure why this doesn't visit( node->function );
    11741195        for ( auto expr : node->args ) {
    11751196                visitExpression( expr );
     
    12281249template< typename pass_type >
    12291250Expression * 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
     1262template< typename pass_type >
     1263void 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
     1272template< typename pass_type >
     1273Expression * PassVisitor< pass_type >::mutate( KeywordCastExpr * node ) {
    12301274        MUTATE_START( node );
    12311275
     
    14911535        indexerScopedAccept( node->result, *this );
    14921536        maybeAccept_impl   ( node->type  , *this );
    1493         maybeAccept_impl   ( node->member, *this );
    14941537
    14951538        VISIT_END( node );
     
    15031546        indexerScopedMutate( node->result, *this );
    15041547        maybeMutate_impl   ( node->type  , *this );
    1505         maybeMutate_impl   ( node->member, *this );
    15061548
    15071549        MUTATE_END( Expression, node );
     
    25572599// TypeSubstitution
    25582600template< 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 >
    25732601TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) {
    25742602        MUTATE_START( node );
Note: See TracChangeset for help on using the changeset viewer.