[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 12 12:46:56 PDT 2019


gribozavr accepted this revision.
gribozavr added inline comments.


================
Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:127
+    if (!hasValidKind(Cases[I].Matcher))
+      return std::vector<DynTypedMatcher>();
+    Buckets[Cases[I].Matcher.getSupportedKind()].emplace_back(I, Cases[I]);
----------------
Returning an empty vector is a valid API choice, but why not assert instead? If an empty vector is returned, unsupported matchers are silently ignored instead of being diagnosed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65877/new/

https://reviews.llvm.org/D65877





More information about the cfe-commits mailing list