I have a tool with multiple matchers. Each different matcher is added to
MatchFinder with a call to addMatcher(). It seems like the order of matches
that are called isn't dependent on the order I added them with addMatcher.
To give a specific example, I'm looking to match variables whose type is a
template parameter (matcher 1) using
fieldDecl(hasType(templateTypeParmType())), which works fine. If I want to
also have a matcher 2 just for fieldDecl(), that matcher is always called
before the more specific template parameter matcher 1.
I tried looking for template parameters inside the fieldDecl matcher with a
"if (isa<TemplateTypeParmType>(TY))", where TY is the FieldDecl type, but
with no success. Instead the type appears to have been already determined
(e.g. float). So is there a way to assure the order that matchers are
called?

Thanks,
Robert
_______________________________________________
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Reply via email to