[PATCH] D80654: WIP: Make it possible to use the traverse() matcher in clang-query

2020-05-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks, this looks quite useful. I should be able to look it over in full tomorrow. Comment at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:383 + static DynTypedMatcher + constructTraversalWrapper(const DynTypedMatcher &InnerMatcher, +

[PATCH] D80685: [ASTMatchers] Add traversal-kind support to `DynTypedMatcher`

2020-05-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: gribozavr, steveire. Herald added a project: clang. This patch exposes `TraversalKind` support in the `DynTypedMatcher` API. While previously, the `match` method supported traversal logic, it was not possible to set or get the traversal kind.

[PATCH] D80606: [libTooling] Fix Transformer to work with ambient traversal kinds

2020-05-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 266729. ymandel added a comment. adds a fix to transformer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80606/new/ https://reviews.llvm.org/D80606 Files: clang/include/clang/Tooling/Transformer/RewriteRule.

[PATCH] D80685: [ASTMatchers] Add traversal-kind support to `DynTypedMatcher`

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 266828. ymandel marked 2 inline comments as done. ymandel added a comment. Herald added a subscriber: mgorny. updated per comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80685/new/ https://reviews.llvm.o

[PATCH] D80685: [ASTMatchers] Add traversal-kind support to `DynTypedMatcher`

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 inline comments as done. ymandel added inline comments. Comment at: clang/lib/ASTMatchers/ASTMatchersInternal.cpp:234 +DynTypedMatcher::constructWithTraversalKind(DynTypedMatcher InnerMatcher, +ast_type_traits::Traversa

[PATCH] D80606: [libTooling] Fix Transformer to work with ambient traversal kinds

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 266831. ymandel added a comment. updated per comments and after rebasing Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80606/new/ https://reviews.llvm.org/D80606 Files: clang/include/clang/Tooling/Transforme

[PATCH] D80606: [libTooling] Fix Transformer to work with ambient traversal kinds

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 266835. ymandel marked 2 inline comments as done. ymandel added a comment. typo fix Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80606/new/ https://reviews.llvm.org/D80606 Files: clang/include/clang/Tooling

[PATCH] D80606: [libTooling] Fix Transformer to work with ambient traversal kinds

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 3 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Tooling/Transformer/RewriteRule.cpp:154 +const RewriteRule &Rule, +ast_type_traits::TraversalKind DefaultTraversalKind) { // Map the cases into buckets of matchers -- one for

[PATCH] D80704: Remove WrapperMatcherInterface

2020-05-28 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. Yes, thank you! There are (IMO) too many layers of abstractions in this framework; this is a good step in the right direction. :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D80606: [libTooling] Fix Transformer to work with ambient traversal kinds

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 266837. ymandel added a comment. more typo fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80606/new/ https://reviews.llvm.org/D80606 Files: clang/include/clang/Tooling/Transformer/RewriteRule.h clang/

[PATCH] D80685: [ASTMatchers] Add traversal-kind support to `DynTypedMatcher`

2020-05-28 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 rG04a96aa3e430: [ASTMatchers] Add traversal-kind support to `DynTypedMatcher` (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D80606: [libTooling] Fix Transformer to work with ambient traversal kinds

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGce5780b88c6e: [libTooling] Fix Transformer to work with ambient traversal kinds. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80606/n

[PATCH] D61837: Make it possible control matcher traversal kind with ASTContext

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:286 + + virtual llvm::Optional TraversalKind() const { +return {}; aaron.ballman wrote: > `traversalKind()` Stephen -- What was the resolution on this comment? I came

[PATCH] D80023: [clang-tidy] Add abseil-string-find-str-contains checker.

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7cfdff7b4a67: [clang-tidy] Add abseil-string-find-str-contains checker. (authored by tdl-g, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D80023: [clang-tidy] Add abseil-string-find-str-contains checker.

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Fixed with commit a1b88afe46d7a0f72d2acd8792951bd959b27545 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80023/new/ https://reviews.llvm.org/D80023

[PATCH] D80697: [clang-tidy] Reworked TransformerClangTidyCheck to simplify usage of Options

2020-05-28 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the suggestioned change. However, I think we can do somewhat simpler. What do you think of just providing a setter on the super class void setRule(Optional Rule) { this->Rule = std::move(Rule); } Subclasses will call `setRule` in their constructor body . O

[PATCH] D80697: [clang-tidy] Reworked TransformerClangTidyCheck to simplify usage of Options

2020-06-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the changes! In D80697#2062517 , @njames93 wrote: > There are a few reasons for using the virtual method: I think I'm missing something (or I didn't explain my intention well): > - It keeps everything contained in th

[PATCH] D80961: WIP: Ignore template instantiations if not in AsIs mode

2020-06-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thank you for bringing up this issue. I think it highlights an underlying problem -- editing templates is quite difficult -- that neither setting will address, as Dmitri expanded on above. Given the parallel to macros, I'd say your change is better than the status quo.

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

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

[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 ast_matchers::MatchFinde

[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 ast_matchers::MatchFinde

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

[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 https:

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

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

[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 https://revie

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

[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 ifBound(std::move

[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 clang/inc

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

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

[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 rewriteDescendants(std::string

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

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

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

[PATCH] D77419: [libTooling] Simplify the representation of Transformer's RewriteRules.

2020-04-03 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a subscriber: jfb. Herald added a project: clang. This revision simplifies the representation of edits in rewrite rules. The simplified form is more general, allowing the user more flexibility in building custom edit

[PATCH] D77419: [libTooling] Simplify the representation of Transformer's RewriteRules.

2020-04-07 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/Transformer/RewriteRule.h:40 + +/// A map from a match result to a list of concrete errors (with possible +/// failure). This type is a building block of rewrite rules

[PATCH] D77419: [libTooling] Simplify the representation of Transformer's RewriteRules.

2020-04-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 255733. ymandel added a comment. replaced name; fixed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77419/new/ https://reviews.llvm.org/D77419 Files: clang-tools-extra/clang-tidy/utils/TransformerC

[PATCH] D77419: [libTooling] Simplify the representation of Transformer's RewriteRules.

2020-04-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 255734. ymandel added a comment. clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77419/new/ https://reviews.llvm.org/D77419 Files: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp

[PATCH] D77419: [libTooling] Simplify the representation of Transformer's RewriteRules.

2020-04-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 2 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/D77419/new/ https://reviews.llvm.org/D77419 ___ cfe-commits mailin

[PATCH] D77419: [libTooling] Simplify the representation of Transformer's RewriteRules.

2020-04-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5e5d36671833: [libTooling] Simplify the representation of Transformer's RewriteRules. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77

[PATCH] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: gribozavr2, tdl-g. Herald added a project: clang. This patch adds a parser for a `RangeSelector` written as a string. The format is closely based on the way one would right the selector in C++, except that bound nodes are referred to by their

[PATCH] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 270866. ymandel added a comment. Herald added a subscriber: mgorny. Added cmake changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81868/new/ https://reviews.llvm.org/D81868 Files: clang/include/clang/To

[PATCH] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 6 inline comments as done. ymandel added a comment. Thanks for the review! Comment at: clang/lib/Tooling/Transformer/Parsing.cpp:29 + +namespace { +using llvm::Error; gribozavr2 wrote: > I'm a bit concerned about the abundance of parsers in Clang

[PATCH] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 271246. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81868/new/ https://reviews.llvm.org/D81868 Files: clang/include/clang/Tooling/Transformer/Parsing.h clang/lib

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

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

[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; aaron.ballma

[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 llvm::Any(

[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] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 271770. ymandel marked 3 inline comments as done. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81868/new/ https://reviews.llvm.org/D81868 Files: clang/include/clang

[PATCH] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 271782. ymandel marked 3 inline comments as done. ymandel added a comment. removed Twine argument per clang-tidy warning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81868/new/ https://reviews.llvm.org/D81868

[PATCH] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81868/new/ https://reviews.llvm.org/D81868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[PATCH] D82126: [libTooling] Change `selection` stencil to handle some cases of text in macros.

2020-06-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. Herald added a project: clang. Currently, the `selection` stencil validates the selection before extracting the text. However, this means that any range inside a macro is rejected as an error. This patch changes the implementatio

[PATCH] D82126: [libTooling] Change Transformer's `cat` to handle some cases of text in macros.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D82126#2103772 , @tdl-g wrote: > LGTM. I found the change description confusing, since it talks about the > selection() stencil but the code is all about the cat() stencil. I realize > (now) that the former is deprecated in

[PATCH] D82126: [libTooling] Change Transformer's `cat` to handle some cases of text in macros.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Tests show that this breaks the test for the clang tidy `abseil-string-find-str-contains`. Curious if this is a desirable change in behavior (in which case I'll update your test file) or the wrong behavior: https://github.com/llvm/llvm-project/blob/master/clang-tools-e

[PATCH] D81868: [libTooling] Add parser for string representation of `RangeSelector`.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel closed this revision. ymandel added a comment. Committed as revision rG9ca50e887db7 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81868/new/ https://reviews.llvm.org/D8

[PATCH] D82126: [libTooling] Change Transformer's `cat` to handle some cases of text in macros.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D82126#2104088 , @tdl-g wrote: > Interesting, in all three of those cases, it's reasonable to replace the > entire expression, thus eliminating the macro. None of those "tear" the > macro; if we had a case like > > #define FO

[PATCH] D82126: [libTooling] Change Transformer's `cat` to handle some cases of text in macros.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 272150. ymandel added a comment. Fixed clang tidy lit test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82126/new/ https://reviews.llvm.org/D82126 Files: clang-tools-extra/test/clang-tidy/checkers/abseil-s

[PATCH] D82179: Move TestClangConfig into libClangTesting and use it in AST Matchers tests

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel marked an inline comment as done. ymandel added a comment. This revision is now accepted and ready to land. Only nits. Really nice work. I much prefer your new system, having wrestled with config and multi-language testing in the existing framework. Howeve

[PATCH] D82225: [libTooling] Delete deprecated `Stencil` combinators.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: tdl-g. Herald added a project: clang. Deletes `text()` and `selection()` combinators, since they have been deprecated for months. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D82225 Files: clang/include/clang/Tooling

[PATCH] D82126: [libTooling] Change Transformer's `cat` to handle some cases of text in macros.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd81d69f1c0c1: [libTooling] Change Transformer's `cat` to handle some cases of text in macros. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D82225: [libTooling] Delete deprecated `Stencil` combinators.

2020-06-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 272157. ymandel added a comment. fix additional refs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82225/new/ https://reviews.llvm.org/D82225 Files: clang/include/clang/Tooling/Transformer/Stencil.h clang/

[PATCH] D82225: [libTooling] Delete deprecated `Stencil` combinators.

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

[PATCH] D82485: Add tests for sequences of callbacks that RecursiveASTVisitor produces

2020-06-24 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/unittests/Tooling/RecursiveASTVisitorTests/Callbacks.cpp:16 +template +class RecordingVisitorBase : public TestVisitor { + bool VisitPostOrder;

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

2020-06-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:335 + template struct is_same_method_impl { +static bool isSameMethod(...) { return false; } + }; Why use var-args rather than spelling out the type arguments like you

[PATCH] D82226: Add Metadata to Transformer tooling

2020-06-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks good! Only real question is one of design -- should we consider the (deeper) change of templating the various types rather than using dynamic typing? For that matter, the decision doesn't even have to be the same for both AtomicChange and the Transformer types. T

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

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

[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). https://github.com/llvm/llvm-project/blob/mast

[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] 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/ https:/

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

[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&id=273763#toc Repository:

[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&id=274484#toc Repository: rG LLVM Git

[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] 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 t

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

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

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

[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: clang-tools-extra/

[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] 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 clang/lib/T

[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: clang-tools-extra/clang-tidy/utils/TransformerC

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

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

[PATCH] D79380: [clang-tidy] In TransformerClangTidyCheck, support option SourceNamingStyle.

2020-05-04 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. The new option allows the user to specify which file naming convention is used by the source code ('llvm' or 'google'). Repository: rG LLVM Github Monorepo

[PATCH] D79380: [clang-tidy] In TransformerClangTidyCheck, support option SourceNamingStyle.

2020-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D79380#2019570 , @gribozavr2 wrote: > LGTM, but I don't understand why this option is called "SourceNamingStyle". > Existing ClangTidy checkers call it "IncludeStyle". Thanks for the review! Good question. I'd planned to cal

[PATCH] D79380: [clang-tidy] In TransformerClangTidyCheck, support option SourceNamingStyle.

2020-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D79380#2020135 , @gribozavr2 wrote: > > It's only effect is to determine how a given file is related to header > > files, specifically how to determine that a header "corresponds" to a the > > file being examined -- that is, i

[PATCH] D79380: [clang-tidy] In TransformerClangTidyCheck, support option SourceNamingStyle.

2020-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 262105. ymandel added a comment. renamed option to IncludeStyle, for consistency w/ existing checks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79380/new/ https://reviews.llvm.org/D79380 Files: clang-tool

[PATCH] D79380: [clang-tidy] In TransformerClangTidyCheck, support option IncludeStyle.

2020-05-05 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc5b1a0352535: [clang-tidy] In TransformerClangTidyCheck, support option IncludeStyle. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79

[PATCH] D80023: [clang-tidy] Add abseil-string-find-str-contains checker.

2020-05-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks good, just some nits! Comment at: clang-tools-extra/clang-tidy/abseil/StringFindStrContainsCheck.cpp:48 + Options.get("StringLikeClasses", DefaultStringLikeClasses)); + const std::string AbseilStringsMatchHeader( + Options.get("Abs

[PATCH] D80239: [libTooling] In Transformer, allow atomic changes to span multiple files.

2020-05-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr. Herald added subscribers: jfb, mgrang. Herald added a project: clang. Currently, all changes returned by a single application of a rule must fit in one atomic change and therefore must apply to one file. However, there are pattern

[PATCH] D132377: [clang][dataflow] Add `SetupTest` parameter for `AnalysisInputs`.

2022-08-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TestingSupport.h:191 + AnalysisOutputs AO{AnnotatedCode, Context, Target, CFCtx, + Analysis, InitEnv, {}}; + if (AI.SetupTest) { --

[PATCH] D132763: [clang][dataflow] Use `StringMap` for storing analysis states at annotated points instead of `vector>`.

2022-08-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TransferTest.cpp:652 ASTContext &ASTCtx) { -ASSERT_THAT(Results, ElementsAre(Pair("p4", _), Pair("p3", _), -

[PATCH] D133588: [NFC] Remove a FIXME fixed by an earlier patch.

2022-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sgatev. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Commit 28bd7945eabdbde2b1fc071ab2f9b78e6e754a1a

[PATCH] D133588: [NFC] Remove a FIXME fixed by an earlier patch.

2022-09-09 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 rGabc16c7a5b0a: [NFC] Remove a FIXME fixed by an earlier patch. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D130270: [clang][dataflow] Use a dedicated bool to encode which branch was taken

2022-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel requested changes to this revision. ymandel added a comment. This revision now requires changes to proceed. It turns out that this change wasn't necessary. I've deleted the relevant FIXME in https://reviews.llvm.org/rGabc16c7a5b0a63d14172262153608b3d24de957f. AFAICT, the reason that the

[PATCH] D130270: [clang][dataflow] Use a dedicated bool to encode which branch was taken

2022-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D130270#3780705 , @samestep wrote: > @ymandel Huh, interesting! I'll go ahead and abandon this patch, then? Please. Sorry I didn't catch this earlier! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:

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