Changeset 7b13aeb


Ignore:
Timestamp:
Jun 5, 2017, 3:16:16 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
c81ebf9
Parents:
7e003011
Message:

PassVisitor? now supports field skip_children

Location:
src/Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    r7e003011 r7b13aeb  
    231231        std::list< Statement* > *       get_beforeStmts() { return stmtsToAddBefore_impl( pass, 0); }
    232232        std::list< Statement* > *       get_afterStmts () { return stmtsToAddAfter_impl ( pass, 0); }
     233        bool visit_children() { bool* skip = skip_children_impl(pass, 0); return ! (skip && *skip); }
    233234};
    234235
  • src/Common/PassVisitor.impl.h

    r7e003011 r7b13aeb  
    33#define VISIT_START( node )  \
    44        call_previsit( node ); \
    5 
    6 #define VISIT_END( node )                \
     5        if( visit_children() ) { \
     6
     7#define VISIT_END( node )            \
     8        }                              \
    79        return call_postvisit( node ); \
    810
    911#define MUTATE_START( node )  \
    1012        call_premutate( node ); \
     13        if( visit_children() ) { \
    1114
    1215#define MUTATE_END( type, node )                \
     16        }                                         \
    1317        return call_postmutate< type * >( node ); \
    1418
  • src/Common/PassVisitor.proto.h

    r7e003011 r7b13aeb  
    8181FIELD_PTR( std::list< Statement* >, stmtsToAddBefore )
    8282FIELD_PTR( std::list< Statement* >, stmtsToAddAfter  )
     83FIELD_PTR( bool, skip_children )
Note: See TracChangeset for help on using the changeset viewer.