[PATCH] D83820: Change metadata to deferred evalutaion in Clang Transformer.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 08:34:41 PDT 2020


ymandel accepted this revision.
ymandel added inline comments.


================
Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:92
   TextGenerator Note;
-  llvm::Any Metadata;
+  AnyGenerator Metadata = [](const ast_matchers::MatchFinder::MatchResult &) {
+    return llvm::Any();
----------------
Why default, especially when we don't default the others? Is it worth a comment?


================
Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:269
+// TODO(asoffer): If this returns an llvm::Expected, should we unwrap?
+template <typename Callable>
+inline ASTEdit withMetadata(ASTEdit Edit, Callable Metadata) {
----------------
Why generalize to support any callable? Perhaps worth explaining in comment?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83820





More information about the cfe-commits mailing list