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

2019-07-18 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 rL366469: [LibTooling] Add function to translate and validate source range for editing (authored by ymandel, committed by ). Herald added a project: LLVM. Herald add

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

2019-07-18 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 rL366473: [LibTooling] Relax Transformer to allow rewriting macro expansions (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subsc

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added a project: clang. This patch removes an (artificial) limitation of `applyFirst`, which requires that all of the rules' matchers can be grouped together in a single `anyOf()`. This change generalizes the code to group

[PATCH] D65879: [clang-tidy] Update `TransformerClangTidyCheck` to use new `buildMatchers` functionality.

2019-08-07 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. `buildMatchers` is the new, more general way to extract the matcher from a rule. This change migrates the code to use it instead of `buildMatcher`. Repository:

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 213932. ymandel added a comment. fix comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65877/new/ https://reviews.llvm.org/D65877 Files: clang/include/clang/Tooling/Refactoring/Transformer.h clang/lib

[PATCH] D65944: [clang] Update `ignoringElidableConstructorCall` matcher to ignore `ExprWithCleanups`.

2019-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added a project: clang. The `ExprWithCleanups` node is added to the AST along with the elidable CXXConstructExpr. If it is the outermost node of the node being matched, ignore it as well. Repository: rG LLVM Github Mon

[PATCH] D65944: [clang] Update `ignoringElidableConstructorCall` matcher to ignore `ExprWithCleanups`.

2019-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 214159. ymandel marked an inline comment as done. ymandel added a comment. Added test; adjusted comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65944/new/ https://reviews.llvm.org/D65944 Files: clang

[PATCH] D65944: [clang] Update `ignoringElidableConstructorCall` matcher to ignore `ExprWithCleanups`.

2019-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added a comment. Thanks for the comments. I struggled with the wording so your edits are appreciated. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:6556 /// -/// ``varDecl(hasInitializer(any( -/// ignoringEli

[PATCH] D65944: [clang] Update `ignoringElidableConstructorCall` matcher to ignore `ExprWithCleanups`.

2019-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 214188. ymandel marked an inline comment as done. ymandel added a comment. updated HTML docs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65944/new/ https://reviews.llvm.org/D65944 Files: clang/docs/LibAST

[PATCH] D65944: [clang] Update `ignoringElidableConstructorCall` matcher to ignore `ExprWithCleanups`.

2019-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368319: [clang] Update `ignoringElidableConstructorCall` matcher to ignore… (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to co

[PATCH] D65963: [clang][NFC] Move matcher ignoringElidableConstructorCall's tests to appropriate file.

2019-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added a project: clang. `ignoringElidableConstructorCall` is a traversal matcher, but its tests are grouped with narrowing-matcher tests. This revision moves them to the correct file. Repository: rG LLVM Github Monorepo

[PATCH] D65963: [clang][NFC] Move matcher ignoringElidableConstructorCall's tests to appropriate file.

2019-08-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368326: [clang][NFC] Move matcher ignoringElidableConstructorCall's tests to… (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 214442. ymandel marked 14 inline comments as done. ymandel added a comment. Rewrote the code and tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65877/new/ https://reviews.llvm.org/D65877 Files: clang/i

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. Thanks for your detailed and helpful feedback. Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:129 + Buckets.back().Cases.emplace_back(CaseId, std::move(Case)); } gribozavr wrote:

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added a comment. I was going to add a test for `Type`/`QualType` and realized that they don't carry any source location info. Therefore, I don't think they belong as top-level matchers for rewrite rules. Instead, users should use `typeLoc(loc(

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. In D65877#1625616 , @gribozavr wrote: > I'd prefer we ban them completely, and let the user wrap them manually if > they need to. While some users would appreciate the ergonomics, I think

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 214679. ymandel added a comment. Bans qualtype and type and adds corresponding comments and test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65877/new/ https://reviews.llvm.org/D65877 Files: clang/include

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 214700. ymandel added a comment. Changed early return to assertion; updated test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65877/new/ https://reviews.llvm.org/D65877 Files: clang/include/clang/Tooling/R

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-12 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:127 +if (!hasValidKind(Cases[I].Matcher)) + return std::vector(); +Buckets[Cases[I].Matcher.getSupportedKind()].emplace_back(I, Cases[I]

[PATCH] D65877: [libTooling] In Transformer, generalize `applyFirst` to admit rules with incompatible matchers.

2019-08-13 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 rL368681: [libTooling] In Transformer, generalize `applyFirst` to admit rules with… (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added

[PATCH] D65879: [clang-tidy] Update `TransformerClangTidyCheck` to use new `buildMatchers` functionality.

2019-08-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368700: [clang-tidy] Update `TransformerClangTidyCheck` to use new `buildMatchers`… (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed pri

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

2019-06-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 206253. ymandel marked an inline comment as done. ymandel added a comment. Added tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63288/new/ https://reviews.llvm.org/D63288 Files: clang-tools-extra/clang

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

2019-06-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 206258. ymandel marked 4 inline comments as done. ymandel added a comment. Adjust comments in test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63288/new/ https://reviews.llvm.org/D63288 Files: clang-tools

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

2019-06-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:33 +StringRef Name, ClangTidyContext *Context) +: ClangTidyCheck(Name, Context), Rule(MakeRule(getLangOpts(), Options)) { + assert(llvm::all_of(Rule.Cases, [](cons

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

2019-06-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp:92 + const std::string Input = "void log(int);"; + EXPECT_EQ(Input, test::runCheckOnCode(Input)); +} g

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

2019-06-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp:92 + const std::string Input = "void log(int);"; + EXPECT_EQ(Input, test::runCheckOnCode(Input)); +} y

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

2019-06-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp:92 + const std::string Input = "void log(int);"; + EXPECT_EQ(Input, test::runCheckOnCode(Input)); +} y

[PATCH] D63784: [clang-tidy] Fix ClangTidyTest to initialize context before checks.

2019-06-25 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. Currently, `clang::tidy::test::runCheckOnCode()` constructs the check instances *before* initializing the ClangTidyContext. This ordering causes problems when th

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

2019-06-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 206510. ymandel added a comment. Rebase onto fix to `runCheckOnCode`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63288/new/ https://reviews.llvm.org/D63288 Files: clang-tools-extra/clang-tidy/utils/Transf

[PATCH] D63784: [clang-tidy] Fix ClangTidyTest to initialize context before checks.

2019-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 206667. ymandel marked 3 inline comments as done. ymandel added a comment. responded to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63784/new/ https://reviews.llvm.org/D63784 Files: clang-tools-e

[PATCH] D63784: [clang-tidy] Fix ClangTidyTest to initialize context before checks.

2019-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h:48 + +template class TestClangTidyAction : public ASTFrontendAction { gribozavr wrote: > "CheckTypes"? 'cause "Checks" below is also technically a "check list". A

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

2019-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 206668. ymandel added a comment. resp. to comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63288/new/ https://reviews.llvm.org/D63288 Files: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck

[PATCH] D63892: [LibTooling] Extend `RewriteRule` with support for adding includes.

2019-06-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: ilya-biryukov, gribozavr. Herald added a project: clang. This revision allows users to specify the insertion of an included directive (at the top of the file being rewritten) as part of a rewrite rule. These directives are bundled with `Rewr

[PATCH] D63893: [clang-tidy] Extend TransformerClangTidyCheck to support adding includes.

2019-06-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: ilya-biryukov, gribozavr. Herald added a subscriber: xazax.hun. Herald added a project: clang. ymandel added a parent revision: D63892: [LibTooling] Extend `RewriteRule` with support for adding includes.. This revision implements support for

[PATCH] D63892: [LibTooling] Extend `RewriteRule` with support for adding includes.

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

[PATCH] D63893: [clang-tidy] Extend TransformerClangTidyCheck to support adding includes.

2019-06-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 207085. ymandel added a comment. Added check for use of AddedIncludes before allocating/registering IncludeInserter. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63893/new/ https://reviews.llvm.org/D63893 Fi

[PATCH] D63892: [LibTooling] Extend `RewriteRule` with support for adding includes.

2019-06-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 207082. ymandel added a comment. Responded to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63892/new/ https://reviews.llvm.org/D63892 Files: clang/include/clang/Tooling/Refactoring/Transformer.h

[PATCH] D60974: Clang IFSO driver action.

2019-07-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. The tests for this code are failing in my build. Any suggestions welcome. My setup: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang-7 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-7 -DCMAKE_C_FLAGS='-gmlt -Wall' -DCMAKE_CXX_FLAGS='-gmlt -Wall' -D

[PATCH] D60974: Clang IFSO driver action.

2019-07-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D60974#1565054 , @plotfi wrote: > So I think I know what may be going on on your end. The llvm-readelf in your > path I believe might be the wrong lllvm-readelf (llvm-readelf-7). Are you > sure you built llvm-readelf from git?

[PATCH] D60974: Clang IFSO driver action.

2019-07-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. `ninja install` did the trick. Thanks for your help! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60974/new/ https://reviews.llvm.org/D60974 ___ cfe-commits mailing list cfe-

[PATCH] D63892: [LibTooling] Extend `RewriteRule` with support for adding includes.

2019-07-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL364917: [LibTooling] Extend `RewriteRule` with support for adding includes. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to co

[PATCH] D63893: [clang-tidy] Extend TransformerClangTidyCheck to support adding includes.

2019-07-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 207538. ymandel added a comment. switched to llvm::any_of. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63893/new/ https://reviews.llvm.org/D63893 Files: clang-tools-extra/clang-tidy/utils/TransformerClangT

[PATCH] D63893: [clang-tidy] Extend TransformerClangTidyCheck to support adding includes.

2019-07-02 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/TransformerClangTidyCheck.cpp:51 + // includes. + if (Rule && std::any_of(Rule->Cases.begin(), Rule->Cases.end(), + [](const RewriteR

[PATCH] D63893: [clang-tidy] Extend TransformerClangTidyCheck to support adding includes.

2019-07-02 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 rL364922: [clang-tidy] Extend TransformerClangTidyCheck to support adding includes. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added

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

2019-07-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a project: clang. Currently, Transformer rejects any changes to source locations inside macro expansions. This change relaxes that constraint to allow rewrites when the entirety of the expansion is replaced, since

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Ilya, this revision follows up from our discussion on the doc. It adds some more selectors. If this change is to big, I'm happy to split it up (e.g. moving the changes to SourceCode to a separate revision and/or splitting up the RangeSelector changes). Also, I have th

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a subscriber: mgorny. Herald added a project: clang. NOTE: This is a preliminary revision for discussion; tests have not yet been provided. The RangeSelector library defines a combinator language for specifying

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

2019-05-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added a comment. Agreed on all the comments -- just one question: Comment at: clang/lib/Tooling/Refactoring/Transformer.cpp:250 + assert(!CommonKind.isNone() && "Cases must have compatible matchers."); + return DynTypedMatcher

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

2019-05-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 199465. ymandel edited the summary of this revision. ymandel added a comment. Response to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61335/new/ https://reviews.llvm.org/D61335 Files: clang/inclu

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

2019-05-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 9 inline comments as done and an inline comment as not done. ymandel added a comment. Thanks for the review. PTAL. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:196 +/// Joins multiple rules into a single rule that applies the first rule in +/

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

2019-05-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:196 +/// Joins multiple rules into a single rule that applies the first rule in +/// `Rules` whose pattern matches a given node. All of the rules must use the +/// same kind of matche

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

2019-05-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 199476. ymandel marked 18 inline comments as done. ymandel added a comment. Herald added a subscriber: jfb. responded to comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61335/new/ https://reviews.llvm.o

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

2019-05-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 199869. ymandel added a comment. adjust some API comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61335/new/ https://reviews.llvm.org/D61335 Files: clang/include/clang/Tooling/Refactoring/Transformer.

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

2019-05-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 5 inline comments as done. ymandel added a comment. Thanks!! Comment at: clang/include/clang/Tooling/Refactoring/Transformer.h:278 +/// Builds the matcher needed for registration. +ast_matchers::internal::DynTypedMatcher buildMatcher(const RewriteRule &Rule); + -

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 199894. ymandel marked 3 inline comments as done. ymandel added a comment. Add tests and back out changes to SourceCode. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 199896. ymandel marked 9 inline comments as done. ymandel added a comment. comment tweak Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774 Files: clang/include/clang/To

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done and an inline comment as not done. ymandel added a comment. Thanks for the review. Added the tests and undid changes to SourceCode. Comment at: clang/include/clang/Tooling/Refactoring/RangeSelector.h:29 + +namespace range_selector { +inl

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

2019-05-17 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/Transformer.h:278 +/// Builds the matcher needed for registration. +ast_matchers::internal::DynTypedMatcher buildMatcher(const RewriteRule &Rule); + --

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

2019-05-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200026. ymandel marked 2 inline comments as done. ymandel added a comment. updated comments; moved some decls. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61335/new/ https://reviews.llvm.org/D61335 Files:

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

2019-05-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200042. ymandel marked an inline comment as done. ymandel added a comment. Synced to HEAD in preparation for committing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61335/new/ https://reviews.llvm.org/D61335

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

2019-05-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC361037: [LibTooling] Add support to Transformer for composing rules as an ordered… (authored by ymandel, committed by ). Changed prior to commit: https://reviews.llvm.org/D61335?vs=200042&id=200044#toc

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200061. ymandel marked 4 inline comments as done. ymandel added a comment. Restructured tests to simplify. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774 Files: clan

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 7 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/RangeSelector.h:29 + +namespace range_selector { +inline RangeSelector charRange(CharSourceRange R) { ilya-biryukov wrote: > ymandel wrote

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

2019-05-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200072. ymandel added a comment. Updated to incorporate changes to Transformer. 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/ut

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200079. ymandel marked 2 inline comments as done. ymandel added a comment. fixed formatting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774 Files: clang/include/clan

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200262. ymandel added a comment. updated some comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774 Files: clang/include/clang/Tooling/Refactoring/RangeSelector.h

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361152: [LibTooling] Add RangeSelector library for defining source ranges based on… (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed pri

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Test file broke gcc builds. Fix in progress... Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D61774: [LibTooling] Add RangeSelector library for defining source ranges based on bound AST nodes.

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Fixed with r361160. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61774/new/ https://reviews.llvm.org/D61774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a project: clang. ymandel updated this revision to Diff 200310. ymandel added a comment. reordered some declarations. Transformer provides an enum to indicate the range of source text to be edited. That support

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200310. ymandel added a comment. reordered some declarations. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62149/new/ https://reviews.llvm.org/D62149 Files: clang/include/clang/Tooling/Refactoring/Transform

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200325. ymandel added a comment. Removed most `change` overloads. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62149/new/ https://reviews.llvm.org/D62149 Files: clang/include/clang/Tooling/Refactoring/Trans

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

2019-05-20 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/Transformer.h:186 +/// where a \c TextGenerator, \c RangeSelector are otherwise expected. +inline ASTEdit change(RangeSelector Target, std::string Replacem

[PATCH] D62160: [LibTooling] Update Stencil to use RangeSelector

2019-05-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sbenza. Herald added a project: clang. Replace Stencil's specialized operators `node` and `sNode` with general support for any RangeSelector. This change allows Stencil to support any RangeSelector and avoids redundancy between the two libr

[PATCH] D59329: [LibTooling] Add NodeId, a strong type for AST-matcher node identifiers.

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel abandoned this revision. ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Refactoring/NodeId.h:29 +public: + explicit NodeId(std::string Id) : Id(std::move(Id)) {} + ilya-biryukov wrote: > W

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

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Ping. Is anyone willing to be the reviewer for this revision? Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61386/new/ https://reviews.llvm.org/D61386 ___ cfe-commits

[PATCH] D56933: [Tooling][RFC] Introduce Stencil library to simplify source code generation in refactorings.

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel abandoned this revision. ymandel added a comment. This ideas in this revisions are gradually being committed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56933/new/ https://reviews.llvm.org/D56933 __

[PATCH] D62201: [LibTooling] Adjust dependencies for unittests.

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: thakis. Herald added a subscriber: mgorny. Herald added a project: clang. Fix a redundant dependency and move another to its proper place. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D62201 Files: clang/unittests/Too

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

2019-05-21 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.h:32 +// }; +class TransformerTidy : public ClangTidyCheck { +public: gribozavr wrote: > I'd prefer a name like "TransformerCla

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

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200536. ymandel added a comment. Renamed TransformerTidy to TransformerClangTidyCheck; classes and files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61386/new/ https://reviews.llvm.org/D61386 Files: clang

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

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added a comment. Thanks for the review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61386/new/ https://reviews.llvm.org/D61386 ___ cfe-commits mailin

[PATCH] D62201: [LibTooling] Address post-commit feedback for r361152

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC361285: [LibTooling] Address post-commit feedback for r361152 (authored by ymandel, committed by ). Changed prior to commit: https://reviews.llvm.org/D62201?vs=200514&id=200559#toc Repository: rC Cla

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

2019-05-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D61386#1510690 , @MyDeveloperDay wrote: > Just a passing comment, Is this: > > a) a different type of check that would be used for a different type of check > than previous clang-tidy checks > b) or is this a replacement on t

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

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:46 + + StringRef Message = "no explanation"; + if (Case.Explanation) { ilya-biryukov wrote: > The users will se

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

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

[PATCH] D62149: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361392: [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed

[PATCH] D62160: [LibTooling] Update Stencil to use RangeSelector

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200747. ymandel added a comment. Add back `node` and `sNode`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62160/new/ https://reviews.llvm.org/D62160 Files: clang/include/clang/Tooling/Refactoring/Stencil.h

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

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 4 inline comments as done. ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:46 + + StringRef Message = "no explanation"; + if (Case.Explanation) { ilya-biryukov wrote: > ymandel wrote: >

[PATCH] D62160: [LibTooling] Update Stencil to use RangeSelector

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200794. ymandel added a comment. Rebase onto HEAD, fixing previous diff which accidentally included other commits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62160/new/ https://reviews.llvm.org/D62160 File

[PATCH] D62160: [LibTooling] Update Stencil to use RangeSelector

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361413: [LibTooling] Update Stencil to use RangeSelector (authored by ymandel, committed by ). Changed prior to commit: https://reviews.llvm.org/D62160?vs=200794&id=200795#toc Repository: rL LLVM CH

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

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 200802. ymandel removed a subscriber: dexonsmith. ymandel added a comment. Replace previous diff which had the wrong base. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61386/new/ https://reviews.llvm.org/D6138

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

2019-05-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361418: [clang-tidy] Add support for writing a check as a Transformer rewrite rule. (authored by ymandel, committed by ). Changed prior to commit: https://reviews.llvm.org/D61386?vs=200802&id=200804#toc

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

2019-05-23 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/TransformerClangTidyCheck.cpp:46 + + StringRef Message = "no explanation"; + if (Case.Explanation) { ilya-biryukov wrote: > ymandel wrote: >

[PATCH] D62320: Fix LLVM_LINK_LLVM_DYLIB build after rC361285

2019-05-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. This revision is now accepted and ready to land. Thanks for fixing this. Might want to wait for Nico's response, though, since the original change was at his suggestion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D62328: [LibTooling] Fix dangling references in RangeSelector.

2019-05-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: ilya-biryukov, gribozavr. Herald added a project: clang. RangeSelector had a number of cases of capturing a StringRef in a lambda, which lead to dangling references. This change converts all uses in the API of `StringRef` to `std::string` to

[PATCH] D62328: [LibTooling] Fix dangling references in RangeSelector.

2019-05-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361514: [LibTooling] Fix dangling references in RangeSelector. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https

[PATCH] D62340: [clang-tidy] In TransformerClangTidyCheck, require Explanation field.

2019-05-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a subscriber: xazax.hun. Herald added a project: clang. In general, the `Explanation` field is optional in `RewriteRule` cases. But, because the primary purpose of clang-tidy checks is to provide users with diagno

[PATCH] D62390: [LibTooling] Add Explanation parameter to `makeRule`.

2019-05-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: ilya-biryukov. Herald added a project: clang. Conceptually, a single-case RewriteRule has a matcher, edit(s) and an (optional) explanation. `makeRule` previously only took the matcher and edit(s). This change adds (optional) support for the

[PATCH] D62340: [clang-tidy] In TransformerClangTidyCheck, require Explanation field.

2019-05-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/unittests/clang-tidy/TransformerClangTidyCheckTest.cpp:38 " else ", statement(T; + Rule.Cases[0].Explanation = tooling::text("no explanation"); + return Rule; --

[PATCH] D62390: [LibTooling] Add Explanation parameter to `makeRule`.

2019-05-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL361643: [LibTooling] Add Explanation parameter to `makeRule`. (authored by ymandel, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https:

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