Add a matcher for decls that has a specific attribute.
Diff Detail
Event Timeline
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3669–3672 | If we have this matcher, do the specialized ones still provide enough value? I was expecting us to either go for the specialized ones, or provide a generic one. Having both in the interface seems odd... |
Removed specialized attribute matchers in favor of retaining generic one.
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
3669–3672 | Agreed. I'll remove the specialized ones. |
lib/ASTMatchers/Dynamic/Registry.cpp | ||
---|---|---|
185–187 | And now that I see how this affects the dynamic matchers, I wonder how we're going to fix that up - that is, we'll need to teach the dynamic matchers to understand the possible clang attributes somehow. |
Re-implemented by having hasAttr take a parameter of type attr::Kind instead to avoid using templates and ease register dynamic matcher.
lib/ASTMatchers/Dynamic/Marshallers.h | ||
---|---|---|
79–88 | And that's enough to make the dynamic matchers work? Can you add an example to the dynamic matchers test? Thx! |
Interface to dynamic matcher using hasAttr now uses a string specification of the attribute instead of requiring the numerical enum value.
+richard, since this is now touching lib/Basic...
Looks good to me, but I want Richard to take a look whether this makes sense or should be solved differently.
If we have this matcher, do the specialized ones still provide enough value? I was expecting us to either go for the specialized ones, or provide a generic one. Having both in the interface seems odd...