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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 2 10:29:40 PDT 2019


ilya-biryukov added a comment.

- Could you provide a few real-world motivating examples?  Especially interested in cases that were complicated before and are easy to do now?
- Do we expect most the rules to be written using the new API or is this something that's gonna be used in `5-10%` of the cases?
- Could we consider expressing the `CompositeRewriteRule` as a `RewriteRule` itself? That might require extending the `RewriteRule` abstraction, but the mental model that makes sense to me is: a rewrite rule matches some AST nodes and applies replacements to them. A `CompositeRewriteRule` seems to match the same model, despite the fact it contains other rules. Would be nice if we could make this fact internal to the implementation.

Also a bit uneasy about the naming. `Composite` suggests the individual rules compose one after another, while in practice only one alternative is chosen.


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