Changeset 0a6aad4 for src


Ignore:
Timestamp:
Nov 30, 2017, 6:06:46 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
c5f3c68
Parents:
c3f551b
git-author:
Rob Schluntz <rschlunt@…> (11/30/17 17:40:49)
git-committer:
Rob Schluntz <rschlunt@…> (11/30/17 18:06:46)
Message:

Convert CallFinder? to PassVisitor?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/InitTweak.cc

    rc3f551b r0a6aad4  
    307307        }
    308308
    309         class CallFinder : public Visitor {
    310         public:
    311                 typedef Visitor Parent;
     309        struct CallFinder {
    312310                CallFinder( const std::list< std::string > & names ) : names( names ) {}
    313311
    314                 virtual void visit( ApplicationExpr * appExpr ) {
     312                void postvisit( ApplicationExpr * appExpr ) {
    315313                        handleCallExpr( appExpr );
    316314                }
    317315
    318                 virtual void visit( UntypedExpr * untypedExpr ) {
     316                void postvisit( UntypedExpr * untypedExpr ) {
    319317                        handleCallExpr( untypedExpr );
    320318                }
     
    326324                template< typename CallExpr >
    327325                void handleCallExpr( CallExpr * expr ) {
    328                         Parent::visit( expr );
    329326                        std::string fname = getFunctionName( expr );
    330327                        if ( std::find( names.begin(), names.end(), fname ) != names.end() ) {
     
    335332
    336333        void collectCtorDtorCalls( Statement * stmt, std::list< Expression * > & matches ) {
    337                 static CallFinder finder( std::list< std::string >{ "?{}", "^?{}" } );
    338                 finder.matches = &matches;
     334                static PassVisitor<CallFinder> finder( std::list< std::string >{ "?{}", "^?{}" } );
     335                finder.pass.matches = &matches;
    339336                maybeAccept( stmt, finder );
    340337        }
Note: See TracChangeset for help on using the changeset viewer.