[PATCH] Replace overloaded ASTMatchFinder::addMatcher() function with one that takes a DynTypedMatcher.

Manuel Klimek klimek at google.com
Wed May 8 13:59:23 PDT 2013



================
Comment at: lib/ASTMatchers/ASTMatchFinder.cpp:647-654
@@ -639,10 +646,10 @@
 bool MatchASTVisitor::TraverseTypeLoc(TypeLoc TypeLocNode) {
   // The RecursiveASTVisitor only visits types if they're not within TypeLocs.
   // We still want to find those types via matchers, so we match them here. Note
   // that the TypeLocs are structurally a shadow-hierarchy to the expressed
   // type, so we visit all involved parts of a compound type when matching on
   // each TypeLoc.
   match(TypeLocNode);
   match(TypeLocNode.getType());
   return RecursiveASTVisitor<MatchASTVisitor>::TraverseTypeLoc(TypeLocNode);
 }
----------------
Samuel Benzaquen wrote:
> Manuel Klimek wrote:
> > Namely here.
> > 
> > I think the right solution sounds more like putting match(*TypeNode) after line 642?
> I made it an overload so that both TraverseType and TraverseTypeLoc get this. If we only want it for TraverseType(), I can move there.
But TraverseTypeLoc already calls match(TypeLocNode.getType()). Wouldn't that lead to too many matches?


http://llvm-reviews.chandlerc.com/D770



More information about the cfe-commits mailing list