[PATCH] D60213: Add clangTooling dependency to fix the build.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. Herald added subscribers: cfe-commits, mgorny. Herald added a project: clang. Fixes https://reviews.llvm.org/D59371, which broke the build for shared libraries. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D60213 Files: clang/lib/Tooling/Refa

[PATCH] D60213: Add clangTooling dependency to fix the build.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D60213#1453516 , @ABataev wrote: > Nope, it won't work. There is a cyclic dependency, unfortunately. > clangTooling depends on clangToolingRefactor already. You need to revert your > commit and refactor it to remove the cyclic

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel reopened this revision. ymandel added a comment. This revision is now accepted and ready to land. Reopening to fix the breakage caused by previous attempt at commit. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D59376

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193584. ymandel added a subscriber: ABataev. ymandel added a comment. Sever dependency of clangToolingRefactor on clangTooling via FixIt. Transformer used FixIt, which causes a problematic dependency. This diff copies the (minimal) code from FixIt to Transfo

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Ilya, this diff fixes the breakage. PTAL. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D59376 ___ cfe-commits mailing list cfe-commits@list

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D59376#1454617 , @ilya-biryukov wrote: > Keeping it **only** in the cpp file also LG if we don't plan to have other > usages for now, but please remove the version from `FixIt.h` The Stencil library will need this as well an

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D59376#1454768 , @ilya-biryukov wrote: > Per @ioeric's suggestion: why not move the helper into > `Tooling/Refactoring/ExtendedRange.h`? > If it's in `ToolingRefactoring`, both stencil and transformer can access it. > > For e

[PATCH] D60269: [LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: ilya-biryukov, ioeric. Herald added a project: clang. Introduces a utility library in Refactoring/ to collect routines related to source-code manipulation. In this change, we move "extended-range" functions from the FixIt library (in clangTo

[PATCH] D60269: [LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193735. ymandel added a comment. Add tests for SourceCode and remove corresponding tests from FixIt tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60269/new/ https://reviews.llvm.org/D60269 Files: clan

[PATCH] D60269: [LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193736. ymandel added a comment. Herald added a subscriber: mgorny. Update CMakeLists.txt and rename (misnamed) test file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60269/new/ https://reviews.llvm.org/D6026

[PATCH] D60269: [LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193741. ymandel added a comment. Various tweaks to get tests compiling/passing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60269/new/ https://reviews.llvm.org/D60269 Files: clang/include/clang/Tooling/Fix

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193748. ymandel added a comment. Switch from using FixIt to SourceCode, as solution to circular dependency problem. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D59376 Fil

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193750. ymandel added a comment. Rebasing to parent D60269 so that diffs show correctly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D593

[PATCH] D60269: [LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

2019-04-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193861. ymandel added a comment. Delete unused function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60269/new/ https://reviews.llvm.org/D60269 Files: clang/include/clang/Tooling/FixIt.h clang/include/cl

[PATCH] D60269: [LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

2019-04-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193865. ymandel added a comment. Fix trailing whitespace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60269/new/ https://reviews.llvm.org/D60269 Files: clang/include/clang/Tooling/FixIt.h clang/include/cl

[PATCH] D60269: [LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

2019-04-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL357764: [LibTooling] Add "SourceCode" library for functions relating to source-code… (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed pr

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 193869. ymandel added a comment. Rebase onto master Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59376/new/ https://reviews.llvm.org/D59376 Files: clang/include/clang/Tooling/Refactoring/Transformer.h cla

[PATCH] D59376: [LibTooling] Add Transformer, a library for source-to-source transformations.

2019-04-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL357768: [LibTooling] Add Transformer, a library for source-to-source transformations. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed p

[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: clang/include/clang/Tooling/Refacto

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a subscriber: jfb. Herald added a project: clang. This revision allows users to specify independent changes to multiple (related) sections of the input. Previously, only a single section of input could be selec

[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 `Text

[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 https://reviews.llvm.org/D59371/new/

[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: 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 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 clang/lib/Tooling/

[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 eval

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-11 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/D60408/new/ https://reviews.llvm.org/D60408 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194883. ymandel marked 2 inline comments as done. ymandel added a comment. Restore code ordering for unrelated code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.org/D60408 Fil

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194886. ymandel added a comment. More code movement (putting things back). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.org/D60408 Files: clang/include/clang/Tooling/Refactor

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194887. ymandel added a comment. Final code shifting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.org/D60408 Files: clang/include/clang/Tooling/Refactoring/Transformer.h c

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D60408#1463909 , @ilya-biryukov wrote: > Sorry for the delay. > There seem to be a few changes that are unrelated to the actual patch. Could > we separate various non-functional changes (moving code around, etc.) into a > se

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 194944. ymandel marked 8 inline comments as done. ymandel added a comment. Responses to comments, including renaming TextChange and applyRewriteRule. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ htt

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:80 +// \endcode +struct TextChange { + // The (bound) id of the node whose source will be replaced. This id should ilya-biryukov wrote: > ymandel wrote: > > ilya-bi

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 195201. ymandel marked 10 inline comments as done. ymandel added a comment. Clarified comments for `translateEdits` function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.org/D6

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:87 + TextGenerator Replacement; + TextGenerator Explanation; +}; ilya-biryukov wrote: > ymandel wrote: > > ilya-biryukov wrote: > > > ymandel wrote: > > > > ilya-bi

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 195234. ymandel marked 2 inline comments as done. ymandel added a comment. Deleted ASTEdit builder; added more `change` overloads. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.o

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 195235. ymandel added a comment. Fix include ordering (bad clang-format config). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.org/D60408 Files: clang/include/clang/Tooling/Re

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:87 + TextGenerator Replacement; + TextGenerator Explanation; +}; ilya-biryukov wrote: > ymandel wrote: > > ilya-biryukov w

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 195364. ymandel added a comment. Cleaned up header comments; added tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.org/D60408 Files: clang/include/clang/Tooling/Refactori

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 195365. ymandel marked 6 inline comments as done. ymandel added a comment. Cleaned up header comments; added tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60408/new/ https://reviews.llvm.org/D60408 File

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 5 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:76 +// `ASTEdit` should be built using the corresponding builder class, +// `ASTEditBuilder`. For example, +// \code ilya-bi

[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 https://reviews.llvm.

[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 ast_

[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: clang/include/clang/Tooling/

[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 &A, const RawTextData &B) { + return A.Text == B.Text; ymandel wrote: > sbenza wro

[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&id=195778#toc Reposito

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ymandel marked 2 inline comments as done. Closed by commit rL358697: [LibTooling] Extend Transformer to support multiple simultaneous changes. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added

[PATCH] D60408: [LibTooling] Extend Transformer to support multiple simultaneous changes.

2019-04-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D60408#1473370 , @liutianle wrote: > hi ymandel, > When I run "check-all", there are some warning/error in TransformerTest.cpp > as follow. My version is llvm:0ee120077 and clang:d87ee8e678. Could you > please have a fix or g

[PATCH] D61005: [LibTooling] Fix unneeded use of unique_ptr where shared_ptr is expected.

2019-04-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sbenza. Herald added a project: clang. This fixes a few places in the Stencil implementation where a unique_ptr is created at a callsite that expects shared_ptr. Since the former implicitly converts to the latter, the code compiles and run

[PATCH] D61015: [LibTooing] Change Transformer's TextGenerator to a partial function.

2019-04-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a project: clang. Changes the signature of the std::function to return an Expected instead of std::string to allow for (non-fatal) failures. Previously, we expected that any failures would be expressed with asser

[PATCH] D61015: [LibTooing] Change Transformer's TextGenerator to a partial function.

2019-04-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D61015#1478539 , @ilya-biryukov wrote: > Why would we consider this a legitimate failure, rather than a programming > error? > Same argument could be made about any form of format-string-like functions, > e.g. `llvm::formatv

[PATCH] D61015: [LibTooing] Change Transformer's TextGenerator to a partial function.

2019-04-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D61015#1478586 , @ilya-biryukov wrote: > I'd argue it's the server's job to validate the inputs in that case. > > The code that landed so far clearly looks like a C++ DSL to describe > transformations of the source. While it *

[PATCH] D61005: [LibTooling] Fix unneeded use of unique_ptr where shared_ptr is expected.

2019-04-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL359468: [LibTooling] Fix unneeded use of unique_ptr where shared_ptr is expected. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 197146. ymandel added a comment. Updated comment to more explicity describe motivation for new signature. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61015/new/ https://reviews.llvm.org/D61015 Files: clang

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 197250. ymandel added a comment. Herald added a subscriber: jfb. Add test for new behavior. In the process, tweak the handling of errors from TextGenerators in Transformer: instead of printing to `llvm::errs`, we set the error in the AtomicChange. Repositor

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 197255. ymandel added a comment. Updates comments on Transformer to make explicit the error reporting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61015/new/ https://reviews.llvm.org/D61015 Files: clang/in

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:205 if (auto Err = TransformationsOrErr.takeError()) { -llvm::errs() << "Transformation failed: " << llvm::toString(std::move(Err)) -

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 197316. ymandel marked 2 inline comments as done. ymandel added a comment. Addresses comments, including error handling style and signature of ChangeConsumer. Updates testing code to use new ChangeConsumer signature. Repository: rG LLVM Github Monorepo

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:164 return SmallVector(); -T.Replacement = Edit.Replacement(Result); +auto ReplacementOrErr = Edit.Replacement(Result); +if (auto

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ymandel marked an inline comment as done. Closed by commit rL359574: [LibTooling] Change Transformer's TextGenerator to a partial function. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a s

[PATCH] D61015: [LibTooling] Change Transformer's TextGenerator to a partial function.

2019-04-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D61015#1484669 , @thakis wrote: > This breaks a test: > http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/12112/steps/check-llvm%20check-clang%20stage3%2Fmsan/logs/stdio > > [--] 1 test f

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

2019-04-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a project: clang. This revision adds a new kind of rewrite rule, `CompositeRewriteRule`, which composes multiple subrules into a new rule that allows ordered-choice among its subrules. With this feature, users can

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: aaron.ballman. Herald added subscribers: cfe-commits, xazax.hun, mgorny. Herald added a project: clang. This revision introduces an adaptor from Transformer's rewrite rules (`clang::tooling::RewriteRule`) to `ClangTidyCheck`. For example, g

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 197589. ymandel added a comment. Reduced use of auto. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61386/new/ https://reviews.llvm.org/D61386 Files: clang-tools-extra/clang-tidy/utils/CMakeLists.txt clang

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerTidy.cpp:22 + // Verify the existence and validity of the AST node that roots this rule. + auto &NodesMap = Result.Nodes.getMap(); + auto Root = N

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 197597. ymandel marked an inline comment as done. ymandel added a comment. reinstated an auto Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61386/new/ https://reviews.llvm.org/D61386 Files: clang-tools-extra

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerTidy.cpp:51 + DiagnosticBuilder Diag = diag(RootLoc, Message); + for (const tooling::Transformation &T : *Transformations) { +Diag << FixItHint

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

2019-05-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D61335#1488212 , @ilya-biryukov wrote: > - Could you provide a few real-world motivating examples? Especially > interested in cases that were complicated before and are easy to do now? Sure, below are some examples based on

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 197836. ymandel marked 2 inline comments as done. ymandel added a comment. responded to comments and shortened (unnecessarily long) variable name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61386/new/ https:

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. In D61386#1487735 , @JonasToth wrote: > I like the new framework! Great! Comment at: clang-tools-extra/unittests/clang-tidy/TransformerTidyTest.cpp:38 + IfInverterTid

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

2019-05-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D61335#1489680 , @ilya-biryukov wrote: > > As for naming, agreed, but does that concern drop away once we have only a > > single RewriteRule definition? > > Sure, that won't be an issue. > > The use-cases make sense, thanks fo

[PATCH] D61386: [clang-tidy] Add support writing a check as a Transformer rewrite rule.

2019-05-06 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/D61386/new/ https://reviews.llvm.org/D61386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

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

2019-05-08 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/D61335/new/ https://reviews.llvm.org/D61335 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.ll

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

2019-05-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 198811. ymandel added a comment. Folded CompositeRewriteRule into RewriteRule and added examples to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61335/new/ https://reviews.llvm.org/D61335 Files: c

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

2019-05-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D61335#1495324 , @ilya-biryukov wrote: > Sorry for the delay. > I personally like the `RewriteRule::Action` best. Allows to use a rather > common term, while still avoiding any possible confusion. I tried going with `Rewrit

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-02-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Aaron, Alex, any additional comments on this change? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56850/new/ https://reviews.llvm.org/D56850 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-02-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 185309. ymandel added a comment. Herald added a project: clang. Sync'd with master. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56849/new/ https://reviews.llvm.org/D56849 Files: clang/docs/LibASTMatchersRe

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-02-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Alex, can you please submit this? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56849/new/ https://reviews.llvm.org/D56849 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-02-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 185977. ymandel added a comment. Sync with head. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56849/new/ https://reviews.llvm.org/D56849 Files: clang/docs/LibASTMatchersReference.html clang/include/clang/

[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

2019-02-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC353532: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers. (authored by ymandel, committed by ). Changed prior to commit: https://reviews.llvm.org/D56849?vs=185977&id=185978#to

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-02-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 187003. ymandel added a comment. Herald added a project: clang. Sync to head. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56850/new/ https://reviews.llvm.org/D56850 Files: clang/unittests/ASTMatchers/ASTMa

[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

2019-02-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL354133: Add tests for assorted `CXXMemberCallExpr` matchers. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https:/

[PATCH] D56851: [ASTMatchers] Adds `CXXMemberCallExpr` matcher `invokedAtType`.

2019-02-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:3300 +/// matches `x.m()` and `p->m()`. +AST_MATCHER_P_OVERLOAD(clang::CXXMemberCallExpr, invokedAtType, + clang::ast_matcher

[PATCH] D58556: [LibTooling] Add "smart" retrieval of AST-node source to FixIt library

2019-02-22 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 a subscriber: jdoerfert. Introduces variants of `getText` and `getSourceRange` that extract the source text of an AST node based on contextual considerations. This revision intro

[PATCH] D62621: [LibTooling] Add insert/remove convenience functions for creating `ASTEdit`s.

2019-06-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Thanks for the review. In D62621#1528714 , @ilya-biryukov wrote: > Are there any corner cases with handling whitespace that we might want to > handle or document them if we don't handle

[PATCH] D62621: [LibTooling] Add insert/remove convenience functions for creating `ASTEdit`s.

2019-06-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 203122. ymandel marked an inline comment as done. ymandel added a comment. adjusted API comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62621/new/ https://reviews.llvm.org/D62621 Files: clang/include

[PATCH] D62621: [LibTooling] Add insert/remove convenience functions for creating `ASTEdit`s.

2019-06-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL362707: [LibTooling] Add insert/remove convenience functions for creating `ASTEdit`s. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed p

[PATCH] D63287: [clang-tidy] Make ClangTidyCheck::OptionsView public.

2019-06-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added a subscriber: xazax.hun. Herald added a project: clang. The `OptionsView` class is currently protected. This constraint prevents tidies from passing the OptionsView to, for example, a helper function. Similarly, Tra

[PATCH] D63288: [clang-tidy] Generalize TransformerClangTidyCheck to take a rule generator.

2019-06-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added a subscriber: xazax.hun. Herald added a project: clang. ymandel added a parent revision: D63287: [clang-tidy] Make ClangTidyCheck::OptionsView public.. Tidy check behavior often depends on language and/or clang-tidy

[PATCH] D63288: [clang-tidy] Generalize TransformerClangTidyCheck to take a rule generator.

2019-06-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Thanks for the review! Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:33 +StringRef Name, ClangTidyContext *Context) +: ClangTidyCheck(Name, Context), Rule(MakeRule(getLangO

[PATCH] D63287: [clang-tidy] Make ClangTidyCheck::OptionsView public.

2019-06-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL363296: [clang-tidy] Make ClangTidyCheck::OptionsView public. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https:

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. In D64518#1585917 , @ilya-biryukov wrote: > This clearly increases the utility of the library, but also seems to add > corner cases that the library won't handle (see the comment about un

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210148. ymandel added a comment. tweaks in response to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64518/new/ https://reviews.llvm.org/D64518 Files: clang/lib/Tooling/Refactoring/Transformer.cpp

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D64518#1589768 , @ilya-biryukov wrote: > In D64518#1588092 , @ymandel wrote: > > > This seems like a good candidate for configuration -- the user could then > > choose which mode to run

[PATCH] D64924: [LibTooling] Add function to translate and validate source range for editing

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a project: clang. Adds the function `getRangeForEdit` to validate that a given source range is editable and, if needed, translate it into a range in the source file (for example, if it's sourced in macro expansion

[PATCH] D64924: [LibTooling] Add function to translate and validate source range for editing

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210573. ymandel added a comment. define matcher instead of operator== Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64924/new/ https://reviews.llvm.org/D64924 Files: clang/include/clang/Tooling/Refactoring/S

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210575. ymandel added a comment. Moved `makeValidRange` to its own revision and rebased onto that. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64518/new/ https://reviews.llvm.org/D64518 Files: clang/lib/To

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:76 +static llvm::Optional +makeValidRange(CharSourceRange Range, const MatchResult &Result) { + const SourceManager &SM = *Result.SourceManager; ---

[PATCH] D64518: [LibTooling] Relax Transformer to allow rewriting macro expansions

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210576. ymandel added a comment. remove unneeded include Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64518/new/ https://reviews.llvm.org/D64518 Files: clang/lib/Tooling/Refactoring/Transformer.cpp clang/

[PATCH] D64924: [LibTooling] Add function to translate and validate source range for editing

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/SourceCode.h:80 +llvm::Optional +getRangeForEdit(const CharSourceRange &EditRange, const ASTContext &Context); } // namespace tooling ily

[PATCH] D64924: [LibTooling] Add function to translate and validate source range for editing

2019-07-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 210608. ymandel added a comment. Added overload. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64924/new/ https://reviews.llvm.org/D64924 Files: clang/include/clang/Tooling/Refactoring/SourceCode.h clang/l

<    1   2   3   4   5   6   7   8   9   10   >