Changeset d8893ca


Ignore:
Timestamp:
Dec 1, 2017, 2:54:03 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
882ad37
Parents:
1e8bbac9
Message:

Update PassVisitor? to add WithStmt? exprs to the Indexer

Location:
src/Common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.h

    r1e8bbac9 rd8893ca  
    298298        void indexerAddUnionFwd ( UnionDecl           * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); }
    299299        void indexerAddTrait    ( TraitDecl           * node ) { indexer_impl_addTrait    ( pass, 0, node ); }
     300        void indexerAddWith     ( WithStmt            * node ) { indexer_impl_addWith    ( pass, 0, node ); }
     301
    300302
    301303        template< typename TreeType, typename VisitorType >
  • src/Common/PassVisitor.impl.h

    r1e8bbac9 rd8893ca  
    985985}
    986986
     987
     988
    987989//--------------------------------------------------------------------------
    988990// NullStmt
    989991template< typename pass_type >
    990992void PassVisitor< pass_type >::visit( WithStmt * node ) {
    991         VISIT_BODY( node );
     993        VISIT_START( node );
     994        maybeAccept_impl( node->exprs, *this );
     995        {
     996                // catch statements introduce a level of scope (for the caught exception)
     997                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     998                indexerAddWith( node );
     999                maybeAccept_impl( node->stmt, *this );
     1000        }
     1001        VISIT_END( node );
    9921002}
    9931003
    9941004template< typename pass_type >
    9951005Statement * PassVisitor< pass_type >::mutate( WithStmt * node ) {
    996         MUTATE_BODY( Statement, node );
     1006        MUTATE_START( node );
     1007        maybeMutate_impl( node->exprs, *this );
     1008        {
     1009                // catch statements introduce a level of scope (for the caught exception)
     1010                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     1011                indexerAddWith( node );
     1012                maybeMutate_impl( node->stmt, *this );
     1013        }
     1014        MUTATE_END( Statement, node );
    9971015}
    9981016
  • src/Common/PassVisitor.proto.h

    r1e8bbac9 rd8893ca  
    208208INDEXER_FUNC( addUnion  , UnionDecl *           );
    209209INDEXER_FUNC( addTrait  , TraitDecl *           );
     210INDEXER_FUNC( addWith   , WithStmt *            );
    210211
    211212
Note: See TracChangeset for help on using the changeset viewer.