[PATCH] D84310: [libTooling] Add assorted `EditGenerator` combinators.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 23 10:02:52 PDT 2020


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


================
Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:125
+/// not bound, then no edits are produced.
+inline EditGenerator ifBound(std::string ID, ASTEdit TrueEdit) {
+  return ifBound(std::move(ID), edit(std::move(TrueEdit)), noEdits());
----------------
asoffer wrote:
> I don't know about LLVM style preferences here, but a default argument to the example above seems reasonable too.
I'd like that, but don't see how to get the types to work out, "noEdits" is a generator, but FalseEdit branch is an `ASTEdit`. did you have something in mind?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84310





More information about the cfe-commits mailing list