[PATCH] D84409: [libTooling] Add an `EditGenerator` that applies a rule throughout a bound node.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 07:34:25 PDT 2020


ymandel marked 7 inline comments as done.
ymandel added inline comments.


================
Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:337
+// refer to nodes bound by the calling rule. `Rule` is not applied to the node
+// itself.
+EditGenerator rewriteDescendants(std::string NodeId, RewriteRule Rule);
----------------
gribozavr2 wrote:
> Please use three slashes for doc comments.
Done, thanks for catching! Also, added example.


================
Comment at: clang/lib/Tooling/Transformer/RewriteRule.cpp:194
+    for (auto &Matcher : transformer::detail::buildMatchers(Rule))
+      MF->addMatcher(forEachDescendantDynamically<T>(std::move(Nodes), Matcher),
+                     this);
----------------
gribozavr2 wrote:
> Wouldn't this line move the same value multiple times?
good catch!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84409





More information about the cfe-commits mailing list