ymandel marked 2 inline comments as done.
ymandel 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]);
----------------
gribozavr wrote:
> 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.
Good point. I generally dislike assertions, but at this point the caller is 
passing a malformed-rule and it is not the place for returning errors.  If we 
plug this support into a UI, we can add filters on the front end that fail 
nicely and return error messages rather than die.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65877



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to