[PATCH] D61335: [LibTooling] Add support to Transformer for composing rules as an ordered choice.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 14 08:19:07 PDT 2019


ymandel marked an inline comment as done.
ymandel added a comment.

Agreed on all the comments -- just one question:



================
Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:250
+  assert(!CommonKind.isNone() && "Cases must have compatible matchers.");
+  return DynTypedMatcher::constructVariadic(
+      DynTypedMatcher::VO_AnyOf, CommonKind, taggedMatchers("Tag", Rule.Cases));
----------------
ilya-biryukov wrote:
> I wonder if there a better way to construct an `anyOf` matcher that can tell which case matched...
> It looks to be the reason for a more complicated interface on the transformer side, but I'm not sure there's a way out of it.
> 
> Any ideas?
I don't quite follow. Which interface complication are you referring to?  FWIW, the reason the code here doesn't just use the anyOf() matches is that it doesn't take a vector -- it only has a variadic form.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61335





More information about the cfe-commits mailing list