[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC358691: [LibTooling] Add Stencil library for format-string style codegen. (authored by ymandel, committed by ). Changed prior to commit: https://reviews.llvm.org/D59371?vs=195606=195778#toc

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/lib/Tooling/Refactoring/Stencil.cpp:78 + +template <> bool isEqualData(const RawTextData , const RawTextData ) { + return A.Text == B.Text; ymandel wrote: > sbenza wrote:

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 195606. ymandel added a comment. Convert template specialization to overload sets. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files:

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Stencil.h:127 + // Allow Stencils to operate as std::function, for compatibility with + // Transformer's TextGenerator. Calls `eval()` and asserts on failure. + std::string operator()(const

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 195602. ymandel marked 9 inline comments as done. ymandel added a comment. Responded to comments, including changing call operator to return Expected instead of string. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-17 Thread Samuel Benzaquen via Phabricator via cfe-commits
sbenza added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Stencil.h:45 + /// Evaluates this part to a string and appends it to `result`. + virtual llvm::Error eval(const ast_matchers::MatchFinder::MatchResult , + std::string

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194551. ymandel added a comment. tweaks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files: clang/include/clang/Tooling/Refactoring/Stencil.h

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the review. I've changed most of the things with only a few open questions. PTAL. Comment at: clang/include/clang/Tooling/Refactoring/Stencil.h:45 + /// Evaluates this part to a string and appends it to `result`. + virtual llvm::Error

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194550. ymandel added a comment. deleted some stray comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files:

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194549. ymandel marked 13 inline comments as done. ymandel added a comment. Responded to comments and added wrapper for Stencil::cat in stencil namespace. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-10 Thread Samuel Benzaquen via Phabricator via cfe-commits
sbenza added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Stencil.h:45 + /// Evaluates this part to a string and appends it to `result`. + virtual llvm::Error eval(const ast_matchers::MatchFinder::MatchResult , + std::string

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194157. ymandel added a comment. Add `operator()` to Stencil for compatability with TextGenerator. Stencil is technically independent of Transformer. However, Transformers replacements and explanations take a generic std::function (there abbreviated as

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193906. ymandel added a comment. Adjust to use SourceCode instead of FixIt. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files:

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193498. ymandel added a comment. Remove noisy default-defined constructors/operators Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files:

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193496. ymandel added a comment. Sever dependency on NodeId and some general cleanup. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files:

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-03-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. gentle ping... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 190683. ymandel added a comment. Build fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59371/new/ https://reviews.llvm.org/D59371 Files: clang/include/clang/Tooling/Refactoring/Stencil.h

[PATCH] D59371: [LibTooling] Add Stencil library for format-string style codegen.

2019-03-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. ymandel added a project: clang. Herald added subscribers: jdoerfert, jfb, mgorny. This file defines the *Stencil* abstraction: a code-generating object, parameterized by named references to (bound) AST nodes. Given a match