Changeset 0a6aad4 for src/InitTweak
- Timestamp:
- Nov 30, 2017, 6:06:46 PM (7 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/InitTweak.cc
rc3f551b r0a6aad4 307 307 } 308 308 309 class CallFinder : public Visitor { 310 public: 311 typedef Visitor Parent; 309 struct CallFinder { 312 310 CallFinder( const std::list< std::string > & names ) : names( names ) {} 313 311 314 v irtual voidvisit( ApplicationExpr * appExpr ) {312 void postvisit( ApplicationExpr * appExpr ) { 315 313 handleCallExpr( appExpr ); 316 314 } 317 315 318 v irtual voidvisit( UntypedExpr * untypedExpr ) {316 void postvisit( UntypedExpr * untypedExpr ) { 319 317 handleCallExpr( untypedExpr ); 320 318 } … … 326 324 template< typename CallExpr > 327 325 void handleCallExpr( CallExpr * expr ) { 328 Parent::visit( expr );329 326 std::string fname = getFunctionName( expr ); 330 327 if ( std::find( names.begin(), names.end(), fname ) != names.end() ) { … … 335 332 336 333 void collectCtorDtorCalls( Statement * stmt, std::list< Expression * > & matches ) { 337 static CallFinderfinder( std::list< std::string >{ "?{}", "^?{}" } );338 finder. matches = &matches;334 static PassVisitor<CallFinder> finder( std::list< std::string >{ "?{}", "^?{}" } ); 335 finder.pass.matches = &matches; 339 336 maybeAccept( stmt, finder ); 340 337 }
Note: See TracChangeset
for help on using the changeset viewer.