Ignore:
File:
1 edited

Legend:

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

    r9a705dc8 r09a1ae6  
    3838        MUTATE_END( type, node );      \
    3939
    40 
     40#include "Common/GC.h"
    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(
     399                        static ObjectDecl* func = new_static_root<ObjectDecl>(
    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(
     429                        static ObjectDecl* func = new_static_root<ObjectDecl>(
    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
    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 );
    706684}
    707685
     
    11931171        indexerScopedAccept( node->result, *this );
    11941172
     1173        // xxx - not quite sure why this doesn't visit( node->function );
    11951174        for ( auto expr : node->args ) {
    11961175                visitExpression( expr );
     
    12491228template< typename pass_type >
    12501229Expression * 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 ) {
    12741230        MUTATE_START( node );
    12751231
     
    15351491        indexerScopedAccept( node->result, *this );
    15361492        maybeAccept_impl   ( node->type  , *this );
     1493        maybeAccept_impl   ( node->member, *this );
    15371494
    15381495        VISIT_END( node );
     
    15461503        indexerScopedMutate( node->result, *this );
    15471504        maybeMutate_impl   ( node->type  , *this );
     1505        maybeMutate_impl   ( node->member, *this );
    15481506
    15491507        MUTATE_END( Expression, node );
     
    25992557// TypeSubstitution
    26002558template< typename pass_type >
     2559void 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
     2572template< typename pass_type >
    26012573TypeSubstitution * PassVisitor< pass_type >::mutate( TypeSubstitution * node ) {
    26022574        MUTATE_START( node );
Note: See TracChangeset for help on using the changeset viewer.