aaron.ballman added a comment.
Generally LGTM but this has no test coverage. What are your plans for how you
want to see this proceed? Do you intend to commit everything in one batch once
all of the reviews are accepted, or do piecemeal commits?
================
Comment at: lib/ASTMatchers/Dynamic/Registry.cpp:565
+template <typename T>
+void processAcceptableMatchers(ArrayRef<ArgKind> AcceptedTypes, T func) {
----------------
I'd prefer `T` to be named `Callable` and `func` to be `Func`. Also, I think it
should be `Callable &&Func`.
================
Comment at: lib/ASTMatchers/Dynamic/Registry.cpp:595
if (!RetKinds.empty() && MaxSpecificity > 0) {
- std::string Decl;
- llvm::raw_string_ostream OS(Decl);
-
- if (IsPolymorphic) {
- OS << "Matcher<T> " << Name << "(Matcher<T>";
- } else {
- OS << "Matcher<" << RetKinds << "> " << Name << "(";
- for (const std::vector<ArgKind> &Arg : ArgsKinds) {
- if (&Arg != &ArgsKinds[0])
- OS << ", ";
-
- bool FirstArgKind = true;
- std::set<ASTNodeKind> MatcherKinds;
- // Two steps. First all non-matchers, then matchers only.
- for (const ArgKind &AK : Arg) {
- if (AK.getArgKind() == ArgKind::AK_Matcher) {
- MatcherKinds.insert(AK.getMatcherKind());
- } else {
- if (!FirstArgKind) OS << "|";
- FirstArgKind = false;
- OS << AK.asString();
+ func(Name, Matcher, RetKinds, ArgsKinds, MaxSpecificity);
+ }
----------------
Then you can use `std::forward<Callable>(Func)(...);` because we can't use
`std::invoke()` yet.
Repository:
rC Clang
https://reviews.llvm.org/D54402
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits