[PATCH] D94453: [libTooling] Add function to Transformer for creating a diagnostic-only rule.

2021-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 316158. ymandel added a comment. Discarded API changes, reduced to new clang-tidy lib test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94453/new/ https://reviews.llvm.org/D94453 Files:

[PATCH] D94453: [libTooling] Add function to Transformer for creating a diagnostic-only rule.

2021-01-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. ymandel requested review of this revision. Herald added a project: clang. Adds a convenience function for creating a rule that only generates a diagnostic, without any correpsonding edits. Repository: rG LLVM Github Monorepo

[PATCH] D93703: [libTooling] Change `addInclude` to use expansion locs.

2021-01-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/D93703/new/ https://reviews.llvm.org/D93703 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D93637: [libTooling] Add support for smart pointers to relevant Transformer `Stencil`s.

2021-01-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG675a2973ee77: [libTooling] Add support for smart pointers to relevant Transformer `Stencil`s. (authored by ymandel). Repository: rG LLVM Github

[PATCH] D93637: [libTooling] Add support for smart pointers to relevant Transformer `Stencil`s.

2021-01-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D93637#2479576 , @tdl-g wrote: > Ah, if it's just an optimization that makes sense. I still think it's worth > having a test case to confirm that one of the specially-handled cases works. Sure. I added one for unique

[PATCH] D93637: [libTooling] Add support for smart pointers to relevant Transformer `Stencil`s.

2021-01-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 314642. ymandel marked an inline comment as done. ymandel added a comment. Added test for unique_ptr specifically. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93637/new/ https://reviews.llvm.org/D93637

[PATCH] D93695: [clang-tidy] Update uses of deprecated Transformer APIs in StringFindStrContainsCheck.

2021-01-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9eb2284f6039: [clang-tidy] Update uses of deprecated Transformer APIs in… (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93695/new/

[PATCH] D93637: [libTooling] Add support for smart pointers to relevant Transformer `Stencil`s.

2021-01-05 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/unittests/Tooling/StencilTest.cpp:273 + std::string Snippet = R"cc( +Smart x; +x; tdl-g wrote: > You're only testing the "QuacksLike" case. I

[PATCH] D93637: [libTooling] Add support for smart pointers to relevant Transformer `Stencil`s.

2021-01-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 314615. ymandel added a comment. added comment known smart pointers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D93637/new/ https://reviews.llvm.org/D93637 Files:

[PATCH] D93703: [libTooling] Change `addInclude` to use expansion locs.

2020-12-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. ymandel requested review of this revision. Herald added a project: clang. This patch changes the default range used to anchor the include insertion to use an expansion loc. This ensures that the location is valid, when the user

[PATCH] D93695: [clang-tidy] Update uses of deprecated Transformer APIs in StringFindStrContainsCheck.

2020-12-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. Herald added a subscriber: xazax.hun. ymandel requested review of this revision. Herald added a project: clang. Migrates `change` to `changeTo`; changes to new constructor API (2-arg construct + `setRule`); refactors use of

[PATCH] D93637: [libTooling] Add support for smart pointers to releveant Transformer `Stencil`s.

2020-12-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: tdl-g, sbenza. ymandel requested review of this revision. Herald added a project: clang. Stencils `maybeDeref` and `maybeAddressOf` are designed to handle nodes that may be pointers. Currently, they only handle native pointers. This patch

[PATCH] D92658: [libTooling] Add `describe` stencil for formatting AST nodes for diagnostics.

2020-12-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe6bc4a71e345: [libTooling] Add `describe` combinator for formatting AST nodes for diagnostics. (authored by ymandel). Changed prior to commit:

[PATCH] D92658: [libTooling] Add `describe` stencil for formatting AST nodes for diagnostics.

2020-12-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. thanks! Comment at: clang/unittests/Tooling/StencilTest.cpp:513 +TEST(StencilToStringTest, DescribeOp) { + auto S = describe("Id"); tdl-g wrote: > Can you add a comment (or a more detailed test name) explaining what this > test

[PATCH] D92658: [libTooling] Add `nodeAsString` stencil for formatting AST nodes for diagnostics.

2020-12-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 309590. ymandel added a comment. updated name, comments and tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92658/new/ https://reviews.llvm.org/D92658 Files:

[PATCH] D92658: [libTooling] Add `formatNode` stencil for formatting AST nodes for diagnostics.

2020-12-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 309542. ymandel added a comment. renamed the combinator Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92658/new/ https://reviews.llvm.org/D92658 Files: clang/include/clang/Tooling/Transformer/Stencil.h

[PATCH] D92658: [libTooling] Add `formatNode` stencil for formatting AST nodes for diagnostics.

2020-12-04 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. ymandel requested review of this revision. Herald added a project: clang. This new stencil combinator is intended for use in diagnostics and the like. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D92658 Files:

[PATCH] D92340: [libTooling][NFC] Remove deprecated Clang Transformer declarations

2020-11-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGfdff677a9557: [libTooling] Remove deprecated Clang Transformer declarations (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D92340: [libTooling] Remove deprecated Clang Transformer declarations

2020-11-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. Herald added a project: clang. ymandel requested review of this revision. A number of declarations were leftover after the move from `clang::tooling` to `clang::transformer`. This patch removes those declarations and upgrades the

[PATCH] D89743: Support Attr in DynTypedNode and ASTMatchers.

2020-11-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/AST/ASTTypeTraits.cpp:138 +return ASTNodeKind(NKI_##A##Attr); +#include "clang/Basic/AttrList.inc" + } aaron.ballman wrote: > Oye, this brings up an interesting point. Plugin-based attributes currently >

[PATCH] D91872: [libTooling] Update Transformer's `node` combinator to include the trailing semicolon for decls.

2020-11-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG88e62085624e: [libTooling] Update Transformers `node` combinator to include the trailing… (authored by ymandel). Changed prior to commit:

[PATCH] D91872: [libTooling] Update Transformer's `node` combinator to include the trailing semicolon for decls.

2020-11-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D91872#2408278 , @aaron.ballman wrote: > Drive-by question from the peanut gallery, sorry if this is an ignorant one > -- not all declarations have a trailing semicolon; is that handled properly? > e.g., `int x;` has a

[PATCH] D91872: [libTooling] Update Transformer's `node` combinator to include the trailing semicolon for decls.

2020-11-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 306707. ymandel added a comment. Clarified that semicolons are only removed if present. Fixed test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91872/new/ https://reviews.llvm.org/D91872 Files:

[PATCH] D91872: [libTooling] Update Transformer's `node` combinator to include the trailing semicolon for decls.

2020-11-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. Herald added a project: clang. ymandel requested review of this revision. Currently, `node` only includes the semicolon for (some) statements. However, declarations have the same issue of trailing semicolons, so `node` should behave

[PATCH] D91544: [clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rule directly.

2020-11-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG068da2c749a5: [clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rule directly. (authored by ymandel). Changed prior to commit: https://reviews.llvm.org/D91544?vs=305516=306151#toc

[PATCH] D91015: [clang-tidy] Extend bugprone-string-constructor-check to std::string_view.

2020-11-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. LGTM. I'll leave it to Aaron, though, to accept. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91015/new/ https://reviews.llvm.org/D91015 ___ cfe-commits mailing list

[PATCH] D91544: [clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rule directly.

2020-11-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a subscriber: xazax.hun. Herald added a project: clang. ymandel requested review of this revision. Adds support for setting the `Rule` field. In the process, refactors the code that accesses that field and adds a

[PATCH] D91015: [clang-tidy] Extend bugprone-string-constructor-check to std::string_view.

2020-11-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp:29-33 +static ast_matchers::internal::Matcher +hasAnyNameStdString(std::vector Names) { + return ast_matchers::internal::Matcher( + new

[PATCH] D82278: Fix traversal over CXXConstructExpr in Syntactic mode

2020-10-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/AST/Expr.cpp:2822 + if (SE->getSourceRange() == E->getSourceRange()) +return Cast->getSubExpr(); +} nit: just `return SE`? Comment at:

[PATCH] D90392: [clang-tidy] Omit std::make_unique/make_shared for default initialization.

2020-10-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp:135 + New->getAllocatedType(), *Result.Context); + if

[PATCH] D89961: [libTooling] Add function to Transformer to create a no-op edit.

2020-10-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6f8f5cb77efd: [libTooling] Add function to Transformer to create a no-op edit. (authored by ymandel). Repository: rG LLVM Github Monorepo

[PATCH] D89961: [libTooling] Add function to Transformer to create a no-op edit.

2020-10-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: tdl-g, gribozavr2. Herald added a project: clang. ymandel requested review of this revision. This functionality is commonly needed in clang tidy checks (based on transformer) that only print warnings, without suggesting any edits. The no-op

[PATCH] D89468: [libTooling] Change `after` range-selector to operate only on source ranges

2020-10-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG65cb4fdd69f4: [libTooling] Change `after` range-selector to operate only on source ranges (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D89468: [libTooling] Change `after` range-selector to operate only on source ranges

2020-10-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/unittests/Tooling/RangeSelectorTest.cpp:196 +static void testAfterMacroArg(StringRef Code) { + const std::string Ref = "ref"; tdl-g wrote: > If this helper function took an "expected" parameter I might consider

[PATCH] D89468: [libTooling] Change `after` range-selector to operate only on source ranges

2020-10-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 298392. ymandel added a comment. cleaned up test code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89468/new/ https://reviews.llvm.org/D89468 Files: clang/lib/Tooling/Transformer/RangeSelector.cpp

[PATCH] D89468: [libTooling] Change `after` range-selector to operate only on source ranges

2020-10-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. Herald added a project: clang. ymandel requested review of this revision. Currently, `after` fails when applied to locations in macro arguments. This change projects the subrange into a file source range and then applies `after`.

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-10-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. TL;DR Stephen's fix works; I'll drop this patch. > Why do you use `TK_IgnoreImplicitCastsAndParentheses` instead of > `TK_IgnoreUnlessSpelledInSource`? All you seem to be doing is showing that > the former is broken. I've always thought we should remove the former.

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D88275#2316484 , @aaron.ballman wrote: > Thank you for your patience while we sort this out. I've pinged @steveire > off-list, so hopefully he'll respond with his thoughts. If we don't hear from > Stephen in the next week or

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-10-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D88275#2305989 , @aaron.ballman wrote: > In D88275#2303283 , @ymandel wrote: > >>> I'm not concerned about the basic idea behind the proposed matcher, I'm >>> only worried we're making

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-09-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. > I'm not concerned about the basic idea behind the proposed matcher, I'm only > worried we're making AST matching more confusing by having two different ways > of inconsistently accomplishing the same-ish thing. Aaron, I appreciate this concern, but I would argue that

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-09-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 294363. ymandel added a comment. restored changes to unrelated parts of html docs. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88275/new/ https://reviews.llvm.org/D88275 Files:

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-09-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D88275#2295379 , @aaron.ballman wrote: > This seems to be strongly related to the `TK_IgnoreUnlessSpelledInSource` > traversal behavior; is there a reason you can't use that traversal mode with > `hasParent()` (does it

[PATCH] D88319: [AST] Delete broken, unused template.

2020-09-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a project: clang. ymandel requested review of this revision. The `const*` overload of `IgnoreExprNodes` can't compile. Moreover, this didn't turn up because it's unused. There's no obvious fix, so I've deleted it.

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-09-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 294348. ymandel added a comment. Fixed to use more standard type adaptors. Registration now works. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88275/new/ https://reviews.llvm.org/D88275 Files:

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-09-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 294312. ymandel added a comment. update dynamic registry and the ast matcher doc. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88275/new/ https://reviews.llvm.org/D88275 Files:

[PATCH] D88275: [ASTMatchers] Add matcher `hasParentIgnoringImplicit`.

2020-09-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a project: clang. ymandel requested review of this revision. This matcher combines the features of the `hasParent` matcher with skip-implicit-expression-nodes behavior of `ignoringImplicit`. It finds the first

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Thanks, this looks great! But, can you also please update https://github.com/llvm/llvm-project/blob/master/clang-tools-extra/clang-tidy/modernize/UseEqualsDeleteCheck.cpp#L39, since it depends on the current semantics? CHANGES SINCE

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D87527#2271059 , @baloghadamsoftware wrote: > We must decide about the namings. If we want to be in sync with the methods > in `FunctionDecl`, then we keep `hasBody()` as is, but remove the template > specialization, and

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D87527#2271016 , @baloghadamsoftware wrote: > In D87527#2270939 , @ymandel wrote: > >> Can you expand on what is wrong currently for `FunctionDecl` descendants? >> Would the new test

[PATCH] D87527: [ASTMatchers] Fix `hasBody` for the descendants of `FunctionDecl`

2020-09-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Can you expand on what is wrong currently for `FunctionDecl` descendants? Would the new test `FindsBodyOfFunctionChildren` fail with the current implementation? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87527/new/

[PATCH] D87409: [libTooling] Fix use of `char` in comparison.

2020-09-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa5cefd95cc60: [libTooling] Fix use of `char` in comparison. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87409/new/

[PATCH] D87409: [libTooling] Fix use of `char` in comparison.

2020-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: lbenes. Herald added a project: clang. ymandel requested review of this revision. Fixes Transformer's `Range` parser to handle `char` in a platform-independent way. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D87409

[PATCH] D87031: [libTooling] Provide overloads of `rewriteDescendants` that operate directly on an AST node.

2020-09-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd4f390313129: [libTooling] Provide overloads of `rewriteDescendants` that operate directly on… (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87031: [libTooling] Provide overloads of `rewriteDescendants` that operate directly on an AST node.

2020-09-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 289623. ymandel added a comment. Herald added a subscriber: JDevlieghere. fix diff base; make small clang-tidy suggested change Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87031/new/

[PATCH] D87031: [libTooling] Provide overloads of `rewriteDescendants` that operate directly on an AST node.

2020-09-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the review! Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:388 +llvm::Expected> +rewriteDescendants(const Decl , RewriteRule Rule, + const ast_matchers::MatchFinder::MatchResult );

[PATCH] D87048: [libTooling] Restore defaults for matchers in makeRule.

2020-09-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6f0a3711bc15: [libTooling] Restore defaults for matchers in makeRule. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87048/new/

[PATCH] D87048: [libTooling] Restore defaults for matchers in makeRule.

2020-09-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added a project: clang. ymandel requested review of this revision. This patch restores the default traversal for Transformer's `makeRule` to `TK_AsIs`. The implicit mode has proven problematic. Repository: rG LLVM

[PATCH] D87031: [libTooling] Provide overloads of `rewriteDescendants` that operate directly on an AST node.

2020-09-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added a project: clang. ymandel requested review of this revision. The new overloads apply directly to a node, like the `clang::ast_matchers::match` functions, Rather than generating an `EditGenerator` combinator.

[PATCH] D85734: [libTooling] Move RewriteRule include edits to ASTEdit granularity.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd8c1f43dcc94: [libTooling] Move RewriteRule include edits to ASTEdit granularity. (authored by ymandel). Repository: rG LLVM Github Monorepo

[PATCH] D85733: [libTooling] Cleanup and reorder `RewriteRule.h`.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG645dd1b3bf8d: [libTooling] Cleanup and reorder `RewriteRule.h`. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D85734: [libTooling] Move RewriteRule include edits to ASTEdit granularity.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 284789. ymandel added a comment. reword comment per suggestion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85734/new/ https://reviews.llvm.org/D85734 Files:

[PATCH] D85733: [libTooling] Cleanup and reorder `RewriteRule.h`.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 284785. ymandel added a comment. fixed typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85733/new/ https://reviews.llvm.org/D85733 Files: clang/include/clang/Tooling/Transformer/RewriteRule.h

[PATCH] D85734: [libTooling] Move RewriteRule include edits to ASTEdit granularity.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 284783. ymandel added a comment. fixed typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85734/new/ https://reviews.llvm.org/D85734 Files: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp

[PATCH] D85734: [libTooling] Move RewriteRule include edits to ASTEdit granularity.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 284781. ymandel added a comment. Updated clang-tidy transformer interpreter correspondingly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85734/new/ https://reviews.llvm.org/D85734 Files:

[PATCH] D85734: [libTooling] Move RewriteRule include edits to ASTEdit granularity.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 284720. ymandel added a comment. tweak Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85734/new/ https://reviews.llvm.org/D85734 Files: clang/include/clang/Tooling/Transformer/RewriteRule.h

[PATCH] D85734: [libTooling] Move RewriteRule include edits to ASTEdit granularity.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: tdl-g, gribozavr2. Herald added a project: clang. ymandel requested review of this revision. Currently, changes to includes are applied to an entire rule. However, include changes may be specific to particular edits within a rule (for

[PATCH] D85733: [libTooling] Cleanup and reorder `RewriteRule.h`.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 284716. ymandel added a comment. fix typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85733/new/ https://reviews.llvm.org/D85733 Files: clang/include/clang/Tooling/Transformer/RewriteRule.h

[PATCH] D85733: [libTooling] Cleanup and reorder `RewriteRule.h`.

2020-08-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a project: clang. ymandel requested review of this revision. This patch lifts `RootID` out of the `RewriteRule` class so that constructs (e.g. inline functions) can that refer to the root id don't need to depend on

[PATCH] D84315: [libTooling] Add a `between` range-selector combinator.

2020-07-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG04a21318b557: [libTooling] Add a `between` range-selector combinator. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D84315: [libTooling] Add a `between` range-selector combinator.

2020-07-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 281268. ymandel added a comment. updated comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84315/new/ https://reviews.llvm.org/D84315 Files: clang/include/clang/Tooling/Transformer/RangeSelector.h

[PATCH] D84409: [libTooling] Add an `EditGenerator` that applies a rule throughout a bound node.

2020-07-24 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 rGc332a984aefc: [libTooling] Add an `EditGenerator` that applies a rule throughout a bound node. (authored by ymandel). Changed prior to commit:

[PATCH] D84409: [libTooling] Add an `EditGenerator` that applies a rule throughout a bound node.

2020-07-24 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/Transformer/RewriteRule.h:337 +// refer to nodes bound by the calling rule. `Rule` is not applied to the node +// itself. +EditGenerator

[PATCH] D84409: [libTooling] Add an `EditGenerator` that applies a rule throughout a bound node.

2020-07-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 280458. ymandel added a comment. addressed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84409/new/ https://reviews.llvm.org/D84409 Files: clang/include/clang/Tooling/Transformer/RewriteRule.h

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

2020-07-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcf428778128f: [libTooling] Add assorted `EditGenerator` combinators. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84310/new/

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

2020-07-24 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 280424. ymandel added a comment. fixed lint Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84310/new/ https://reviews.llvm.org/D84310 Files: clang/include/clang/Tooling/Transformer/MatchConsumer.h

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

2020-07-23 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/Transformer/RewriteRule.h:125 +/// not bound, then no edits are produced. +inline EditGenerator ifBound(std::string ID, ASTEdit TrueEdit) { + return

[PATCH] D84409: [libTooling] Add an `EditGenerator` that applies a rule throughout a bound node.

2020-07-23 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a project: clang. The new combinator, `rewriteDescendants`, applies a rewrite rule to all descendants of a specified bound node. That rewrite rule can refer to nodes bound by the parent, both in the matcher and in

[PATCH] D84315: [libTooling] Add a `between` range-selector combinator.

2020-07-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: asoffer, gribozavr2. Herald added a project: clang. Adds the `between` combinator and registers it with the parser. As a driveby, updates some deprecated names to their current versions. Repository: rG LLVM Github Monorepo

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

2020-07-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 279771. ymandel added a comment. revert unrelated change in `RangeSelector.h` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84310/new/ https://reviews.llvm.org/D84310 Files:

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

2020-07-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: asoffer, gribozavr2. Herald added a project: clang. This patch adds various combinators that help in constructing `EditGenerator`s: - `noEdits` - `ifBound`, specialized to `ASTEdit` - `flatten` and `flattenVector` which allow for easy

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

2020-07-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe5b3202b6f94: [libTooling] In Clang Transformer, change `Metadata` field to deferred… (authored by asoffer, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-07-20 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc0b8954ecba5: [libTooling] In Clang Transformer, change `Metadata` field to deferred… (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-07-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:93 + // Not all transformations will want or need to attach metadata and therefore + // should not be requierd to do so. + AnyGenerator Metadata = [](const

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

2020-07-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:93 + // Not all transformations will want or need to attach metadata and therefore + // sholud not be requierd to do so. AnyGenerator Metadata = [](const

[PATCH] D83868: Use TestClangConfig in AST Matchers tests and run them in more configurations

2020-07-16 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 doing this change! I think it's a great step forward for the testing robustness. I'm scared by how many fixme's we have in this file, but at least they're now explicit, rather

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

2020-07-16 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/Transformer/RewriteRule.h:93 + // Not all transformations will want or need to attach metadata and therefore + // sholud not be requierd to do so. AnyGenerator

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

2020-07-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks like your changes to the .cpp and test files were reverted... Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:93 + // Not all transformations will want or need to attach metadata and therefore + // sholud not be requierd to do

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

2020-07-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/include/clang/Tooling/Transformer/RewriteRule.h:92 TextGenerator Note; - llvm::Any Metadata; + AnyGenerator Metadata = [](const ast_matchers::MatchFinder::MatchResult &) { +return

[PATCH] D82278: Fix traversal over CXXConstructExpr in Syntactic mode

2020-07-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for this fix! Comment at: clang/lib/AST/Expr.cpp:3001 Expr *A = C->getArg(0); -if (A->getSourceRange() == SR || !isa(C)) +if (A->getSourceRange() == SR || C->isElidable()) { E = A;

[PATCH] D82901: [libTooling] Fix `maybeExtendRange` to support `CharRange`s.

2020-07-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGecfa0b24189a: [libTooling] Fix `maybeExtendRange` to support `CharRange`s. (authored by gmatute, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D82921: Removed a RecursiveASTVisitor feature to visit operator kinds with different methods

2020-07-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. +1 Especially given how trivial it was to fix clang/lib/ARCMigrate/TransProperties.cpp, this functionality seems unjustified. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82921/new/

[PATCH] D82901: [libTooling] Fix `maybeExtendRange` to support `CharRange`s.

2020-06-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a project: clang. ymandel added a subscriber: gmatute. Currently, `maybeExtendRange` takes a `CharSourceRange`, but only works correctly for the `TokenRange` case. This change adds proper support for the `CharRange`

[PATCH] D82226: Add Metadata to Transformer tooling

2020-06-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9945bd591163: Add Metadata to Transformer tooling (authored by asoffer, committed by ymandel). Changed prior to commit: https://reviews.llvm.org/D82226?vs=274183=274484#toc Repository: rG LLVM

[PATCH] D82654: [libTooling] Improve error message from failure in selection Stencil

2020-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG30deabf89f93: [libTooling] Improve error message from failure in selection Stencil (authored by ymandel). Changed prior to commit: https://reviews.llvm.org/D82654?vs=273706=273763#toc Repository: rG

[PATCH] D82486: RecursiveASTVisitor: don't call WalkUp unnecessarily in post-order traversal

2020-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:646 + * receives a DataRecursionQueue, can't call WalkUpFrom after traversing \ + * children because it only enqueues the children. and does not

[PATCH] D82592: [libTooling] Rename overloaded `range` range selector.

2020-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG056a539e570a: [libTooling] Rename overloaded `range` range selector. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82592/new/

[PATCH] D82654: [libTooling] Improve error message from failure in selection Stencil

2020-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D82654#2116906 , @gribozavr2 wrote: > Any chance for a test? StencilTest.CatOfInvalidRangeFails essentially covers this (indeed, earlier versions of the code failed this test).

[PATCH] D82226: Add Metadata to Transformer tooling

2020-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D82226#2116931 , @gribozavr2 wrote: > In D82226#2115406 , @asoffer wrote: > > > I think the tradeoff here is > > Dynamic typing -- faster compile times, type safety checked at run-time

[PATCH] D82654: [libTooling] Improve error message from failure in selection Stencil

2020-06-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a project: clang. This patch improves the error message provided by the stencil that handles source from a range selector. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82654 Files:

[PATCH] D82592: [libTooling] Rename overloaded `range` range selector.

2020-06-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. Herald added a project: clang. tdl-g accepted this revision. This revision is now accepted and ready to land. Renames the overloaded `RangeSelector` combinator `range` to the more descriptive `enclose` and `encloseNodes`. The old

<    4   5   6   7   8   9   10   11   12   13   >