[PATCH] D114981: [clang-tidy] Disable support for NOLINTBEGIN/NOLINTEND blocks by default.

2021-12-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. Herald added subscribers: carlosgalvezp, xazax.hun. ymandel requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. This patch parameterizes the clang-tidy diagnostic consumer with a boolean that controls

[PATCH] D108560: [clang-tidy] Add support for `NOLINTBEGIN` ... `NOLINTEND` comments

2021-12-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Aaron, Salman, We've seen a serious perfomance regression caused by this patch. The issue is that the new code scans every file in its entirety for every single diagnostic encountered in that file. In fact, each lines is copied and scanned twice (respectively), so

[PATCH] D114809: Fix documentation for `forEachLambdaCapture` and `hasAnyCapture`

2021-12-02 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 rG4e9e2f241780: Fix documentation for `forEachLambdaCapture` and `hasAnyCapture` (authored by jcking1034, committed by ymandel). Repository: rG

[PATCH] D114809: Fix documentation for `forEachLambdaCapture` and `hasAnyCapture`

2021-12-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D114809#3165214 , @aaron.ballman wrote: > LGTM! I had no idea... > > (As a follow-up question, should we be removing the `using` declarations > starting around line 141 or so? Many of them are not used, and if the >

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-12-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6a9487df73e9: Add new clang-tidy check for string_view(nullptr) (authored by CJ-Johnson, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-12-01 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. To other reviewers: barring any additional comments, I will push this patch tomorrow morning (CJ doesn't have commit rights). Comment at:

[PATCH] D114823: Filter string_view from the nullptr diagnosis of bugprone-string-constructor to prevent duplicate warnings with bugprone-stringview-nullptr

2021-12-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. CJ -- please mention "bugprone-stringview-nullptr" explicitly and explain that it will cover those features, etc. so that the description will be clear on its own. Thanks! Comment at:

[PATCH] D114809: Fix documentation for `forEachLambdaCapture` and `hasAnyCapture`

2021-11-30 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. #TIL :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114809/new/ https://reviews.llvm.org/D114809

[PATCH] D114234: [clang][dataflow] Add base types for building dataflow analyses

2021-11-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6e2aecd759dc: [clang][dataflow] Add base types for building dataflow analyses (authored by sgatev, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D114721: [clang][dataflow] Add unit tests for PostOrderCFGView

2021-11-29 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks good, but why split the test into its own directory? I see that the implementation file is in clang/lib/Analysis and, in general, the lib and unittest directories are often flatter than the corresponding include directories. Maybe just put it directly into

[PATCH] D114234: [clang][dataflow] Add base types for building dataflow analyses

2021-11-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/DataflowAnalysis.cpp:21-22 + +namespace clang { +namespace dataflow { + It's more common in .cpp files to use using declarations instead: ``` using clang; using dataflow; ```

[PATCH] D113917: Add infrastructure to support matcher names.

2021-11-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks good, just small comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchersInternal.h:88 +/// can be useful for cases like debugging matchers. +template std::string makeMatcherNameFromType() { + return "Matcher"; Please

[PATCH] D114011: Add a clang-transformer tutorial

2021-11-17 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. ymandel marked an inline comment as done. Closed by commit rG2b4948448f03: Add a clang-transformer tutorial (authored by ymandel). Repository: rG LLVM Github

[PATCH] D114011: Add a clang-transformer tutorial

2021-11-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 7 inline comments as done. ymandel added a comment. Thanks for the review! Comment at: clang/docs/ClangTransformerTutorial.rst:69 + +Assume you have an API which forbids functions from being named "MkX" and you +want to write a check that catches any violations

[PATCH] D114011: Add a clang-transformer tutorial

2021-11-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 387914. ymandel added a comment. Responses to comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114011/new/ https://reviews.llvm.org/D114011 Files: clang/docs/ClangTransformerTutorial.rst

[PATCH] D114011: Add a clang-transformer tutorial

2021-11-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 387906. ymandel added a comment. removed stray internal reference. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114011/new/ https://reviews.llvm.org/D114011 Files: clang/docs/ClangTransformerTutorial.rst

[PATCH] D114011: Add a clang-transformer tutorial

2021-11-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. Herald added a subscriber: arphaman. ymandel updated this revision to Diff 387719. ymandel added a comment. ymandel edited the summary of this revision. ymandel added reviewers: gribozavr2, aaron.ballman. ymandel changed the edit policy from "All Users" to "Only

[PATCH] D113575: Add `isInitCapture` and `forEachLambdaCapture` matchers.

2021-11-15 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 rG9809c6c61ceb: Add `isInitCapture` and `forEachLambdaCapture` matchers. (authored by jcking1034, committed by ymandel). Repository: rG LLVM Github

[PATCH] D113917: Add infrastructure to support matcher names.

2021-11-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. For a little more context: we're working to improve the debuggability of matchers. The first step in that direction seems to be a change of this sort that provides some (dynamic) introspection so that a tool, library, etc. can see some basic information about the

[PATCH] D113148: Add new clang-tidy check for string_view(nullptr)

2021-11-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. This looks really good. An impressive effort! Just a few changes. Also, please ping Alex to get his opinion on the high level issue. Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:62 +

[PATCH] D113575: Add `isInitCapture` and `forEachLambdaCapture` matchers.

2021-11-12 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/include/clang/ASTMatchers/ASTMatchers.h:4235 + for (const auto : Node.captures()) { +if (Finder->isTraversalIgnoringImplicitNodes() &&

[PATCH] D112647: [clang-apply-replacements] Correctly handle relative paths

2021-11-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8188484daa41: [clang-apply-replacements] Correctly handle relative paths (authored by avogelsgesang, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D112647: [clang-apply-replacements] Correctly handle relative paths

2021-11-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. I can land it for you. should be sometime this afternoon, but ping me tomorrow if you don't see any activity. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112647/new/ https://reviews.llvm.org/D112647

[PATCH] D112647: [clang-apply-replacements] Correctly handle relative paths

2021-11-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp:159 // automatically canonicalized. +auto = SM.getFileManager().getFileSystemOpts().WorkingDir; +auto PrevWorkingDir = WorkingDir;

[PATCH] D112647: [clang-apply-replacements] Correctly handle relative paths

2021-11-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Overall, looks good to me. But, I'd like to get a more experienced reviewer to confirm they're comfortable with the new behavior. Comment at: clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp:159 // automatically

[PATCH] D112491: Add `LambdaCapture`-related matchers.

2021-11-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc0b298fc213c: Add `LambdaCapture`-related matchers. (authored by jcking1034, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D113195: [clang-tidy] Add check for initialization of `absl::Cleanup`.

2021-11-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG16b07c866ae7: [clang-tidy] Add check for initialization of `absl::Cleanup`. (authored by CJ-Johnson, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D113195: [clang-tidy] Add check for initialization of `absl::Cleanup`.

2021-11-04 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. Nice! Comment at: clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.cpp:19 + +using namespace clang::ast_matchers; +using namespace ::clang::transformer;

[PATCH] D112647: [clang-apply-replacements] Correctly handle relative paths

2021-11-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Overall, this looks ok, but I don't feel like I'm qualified to approve this patch, since I'm not really familiar w/ how this tool is used in practice. Some comments nonetheless: > Those relative paths are meant to be resolved relative to the corresponding > build

[PATCH] D112491: Add `LambdaCapture`-related matchers.

2021-11-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4630-4632 +/// lambdaExpr(hasAnyCapture(lambdaCapture(refersToVarDecl(hasName("x", +/// refersToVarDecl(hasName("x")) matches `int x` and `x = 1`. +AST_MATCHER_P(LambdaCapture,

[PATCH] D112491: Add `LambdaCapture`-related matchers.

2021-11-01 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. +1 to removing the old versions of these matchers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112491/new/ https://reviews.llvm.org/D112491 ___ cfe-commits mailing list

[PATCH] D112647: [clang-apply-replacements] Correctly handle relative paths

2021-10-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. I'm not really familiar w/ this code. But, if njames93 doesn't respond, then I'll give it a go. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112647/new/ https://reviews.llvm.org/D112647

[PATCH] D112491: Add `LambdaCapture`-related matchers.

2021-10-26 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Nice! Per Aaron's comment, it's probably worth expanding the patch description to explain the motivation. I assume that the key is making these first-class and therefore bindable? Comment at: clang/include/clang/ASTMatchers/ASTMatchFinder.h:170

[PATCH] D111708: [libTooling] Add "switch"-like Stencil combinator

2021-10-14 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 rGb6c218d4fdb7: [libTooling] Add switch-like Stencil combinator (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D111708: [libTooling] Add "switch"-like Stencil combinator

2021-10-13 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 `selectBound`, a `Stencil` combinator that allows the user to supply multiple alternative cases, discriminated by bound node IDs. Repository: rG LLVM

[PATCH] D111518: Add release note about `TypeLoc` matchers.

2021-10-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG25fabc434ad5: Add release note about `TypeLoc` matchers. (authored by jcking1034, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D111332: [AST Matchers] Update dump_ast_matchers.py to query only class index page.

2021-10-08 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3ab238af4fa4: [AST Matchers] Update dump_ast_matchers.py to query only class index page. (authored by jcking1034, committed by ymandel). Changed prior to commit:

[PATCH] D111242: Add `TypeLoc`-related matchers.

2021-10-08 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 rGac7429656286: Add `TypeLoc`-related matchers. (authored by jcking1034, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D111332: [AST Matchers] Update dump_ast_matchers.py to query only class index page.

2021-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Aaron -- I'm not the right reviewer for this. I've put you as the reviewer, but feel free to re-route if there's someone better. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111332/new/

[PATCH] D111242: Add `TypeLoc`-related matchers.

2021-10-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/docs/LibASTMatchersReference.html:636 -Matcherhttps://clang.llvm.org/doxygen/classclang_1_1Decl.html;>DeclblockDeclMatcherhttps://clang.llvm.org/doxygen/classclang_1_1BlockDecl.html;>BlockDecl...

[PATCH] D111242: Add `TypeLoc`-related matchers.

2021-10-06 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/include/clang/ASTMatchers/ASTMatchers.h:6400 +/// pointerTypeLoc(hasPointeeLoc(loc(asString("int" +/// matches `int*`.

[PATCH] D111242: Add `TypeLoc`-related matchers.

2021-10-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Also, please list the new matchers in the patch description. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111242/new/ https://reviews.llvm.org/D111242 ___ cfe-commits mailing

[PATCH] D111242: Add `TypeLoc`-related matchers.

2021-10-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Nice! Just some minor notes. Comment at: clang/docs/LibASTMatchersReference.html:636 -Matcherhttps://clang.llvm.org/doxygen/classclang_1_1Decl.html;>DeclblockDeclMatcherhttps://clang.llvm.org/doxygen/classclang_1_1BlockDecl.html;>BlockDecl...

[PATCH] D110586: Update `DynTypedNode` to support the conversion of `TypeLoc`s.

2021-10-04 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 rG56e72a40c198: Update `DynTypedNode` to support the conversion of `TypeLoc`s. (authored by jcking1034, committed by ymandel). Repository: rG LLVM

[PATCH] D110586: Update `DynTypedNode` to support the conversion of `TypeLoc`s.

2021-10-01 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/AST/ASTTypeTraitsTest.cpp:207 + auto matches = match(traverse(TK_AsIs, typeLoc().bind("tl")), context); + for (auto : matches) { +

[PATCH] D110586: Update `DynTypedNode` to support the conversion of `TypeLoc`s.

2021-09-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Looks good! Please add a test to be sure it compiles/works correctly. Thanks! Comment at: clang/include/clang/AST/ASTTypeTraits.h:56 /// Construct an identifier for T. - template - static ASTNodeKind getFromNodeKind() { + template static

[PATCH] D109470: Add "profiling" to the list of absl libraries.

2021-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe976fc61ecd9: Add profiling to the list of absl libraries. (authored by nilayvaish, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D109470: Add "profiling" to the list of absl libraries.

2021-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D109470#2992275 , @nilayvaish wrote: > ymandel@, I do not have commit access to the repo. Can you commit this for > me? Thanks! Sure! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D109470: Add "profiling" to the list of absl libraries.

2021-09-09 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D109470#2992161 , @nilayvaish wrote: > In D109470#2992119 , @ymandel wrote: > >> Any idea if there's a test for this matcher that should be updated? > > I looked at the commit that

[PATCH] D109470: Add "profiling" to the list of absl libraries.

2021-09-09 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. Any idea if there's a test for this matcher that should be updated? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109470/new/

[PATCH] D107837: abseil-string-find-str-contains should not propose an edit for the three-parameter version of find().

2021-08-10 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 rG1fdb3e36ff37: abseil-string-find-str-contains should not propose an edit for the three… (authored by tdl-g, committed by ymandel). Repository: rG

[PATCH] D106173: [clang-tidy] performance-unnecessary-copy-initialization: Create option to exclude container types from triggering the check.

2021-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. Looks good. I was only a little confused by the first sentence of the option description. Comment at:

[PATCH] D106011: [clang-tidy] performance-unnecessary-copy-initialization: Disable check when variable and initializer have different replaced template param types.

2021-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. Nice! Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:178-183 + if

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

2021-07-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel abandoned this revision. ymandel added a comment. Fixed in another commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D88319/new/ https://reviews.llvm.org/D88319 ___ cfe-commits mailing list

[PATCH] D105365: [Lexer] Fix bug in `makeFileCharRange` called on split tokens.

2021-07-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG93dc73b1e0f3: [Lexer] Fix bug in `makeFileCharRange` called on split tokens. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D105365: [Lexer] Fix bug in `makeFileCharRange` called on split tokens.

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

[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-12 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/performance/UnnecessaryCopyInitialization.cpp:50 + size_t Offset = std::strcspn(TextAfter, "\n"); + return

[PATCH] D105734: [clang-tidy] performance-unnecessary-copy-initialization: Do not remove comments on new lines.

2021-07-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Given that you're removing a declaration, consider using `tooling::getAssociatedRange` https://source.corp.google.com/piper///depot/google3/third_party/llvm/llvm-project/clang/include/clang/Tooling/Transformer/SourceCode.h;l=44 It does have a different semantics than

[PATCH] D105551: [libTooling] Add support for implicit `this` to `buildAddressOf`.

2021-07-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd2e32fa493a2: [libTooling] Add support for implicit `this` to `buildAddressOf`. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D105551: [libTooling] Add support for implicit `this` to `buildAddressOf`.

2021-07-07 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. Changes `buildAddressOf` to return `this` when given an implicit `this` expression. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D105551

[PATCH] D105365: [Lexer] Fix bug in `makeFileCharRange` called on split tokens.

2021-07-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: sammccall. ymandel requested review of this revision. Herald added a project: clang. When the end loc of the specified range is a split token, `makeFileCharRange` does not process it correctly. This patch adds proper support for split

[PATCH] D104390: [libTooling] Change `access` stencil to recognize use of `operator*`.

2021-06-16 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 rGc7ed4fe56e0a: [libTooling] Change `access` stencil to recognize use of `operator*`. (authored by ymandel). Repository: rG LLVM Github Monorepo

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:62 AST_MATCHER_FUNCTION(StatementMatcher, isInitializedFromReferenceToConst) { auto OldVarDeclRef = This name seems a little off now.

[PATCH] D104389: [ASTMatchers] Fix bug in `hasUnaryOperand`

2021-06-16 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 rG439c9206945a: [ASTMatchers] Fix bug in `hasUnaryOperand` (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D104390: [libTooling] Change `access` stencil to recognize use of `operator*`.

2021-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 352453. ymandel added a comment. add comments and simplify. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104390/new/ https://reviews.llvm.org/D104390 Files: clang/lib/Tooling/Transformer/Stencil.cpp

[PATCH] D104390: [libTooling] Change `access` stencil to recognize use of `operator*`.

2021-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 352450. ymandel added a comment. cleanup tweaks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104390/new/ https://reviews.llvm.org/D104390 Files: clang/lib/Tooling/Transformer/Stencil.cpp

[PATCH] D104390: [libTooling] Change `access` stencil to recognize use of `operator*`.

2021-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. ymandel requested review of this revision. Herald added a project: clang. Currently, `access` doesn't recognize a dereferenced smart pointer. So, `access(e, "field")` where `e = *x`, yields: - `x->field`, for normal-pointer x,

[PATCH] D104389: [ASTMatchers] Fix bug in `hasUnaryOperand`

2021-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. ymandel requested review of this revision. Herald added a project: clang. Currently, `hasUnaryOperand` fails for the overloaded `operator*`. This patch fixes the bug and adds tests for this case. Repository: rG LLVM Github

[PATCH] D104317: [libTooling][NFC] Refactor implemenation of Transformer Stencils to use standard OOP

2021-06-16 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf387c8545d3a: [libTooling][NFC] Refactor implemenation of Transformer Stencils to use… (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D104317: [libTooling][NFC] Refactor implemenation of Transformer Stencils to use standard OOP

2021-06-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/lib/Tooling/Transformer/Stencil.cpp:158 break; } +return (OpName + "(\"" + Id + "\")").str(); gribozavr2 wrote: > Please use spaces instead of tabs (throughout the patch). I think those markers

[PATCH] D104317: [libTooling][NFC] Refactor implemenation of Transformer Stencils to use standard OOP

2021-06-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 352237. ymandel added a comment. try to fix tabs Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104317/new/ https://reviews.llvm.org/D104317 Files: clang/lib/Tooling/Transformer/Stencil.cpp Index:

[PATCH] D104317: [libTooling][NFC] Refactor implemenation of Transformer Stencils to use standard OOP

2021-06-15 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: gribozavr2. ymandel requested review of this revision. Herald added a project: clang. Currently, the implementation combines OOP and overloads, using a template to tie the two together. In practice, this has proven confusing with no

[PATCH] D103087: [clang-tidy] performances-unnecessary-* checks: Extend isOnlyUsedAsConst to expressions and catch const methods returning non-const references/pointers.

2021-06-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D103087#2813901 , @flx wrote: > In D103087#2793673 , @ymandel wrote: > >> I have some concerns about the cost of this checks as it used matching over >> entire contexts quite

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:98-101 auto Matches = match(findAll(declStmt(has(varDecl(equalsNode( .bind("declStmt")), +Body, Context);

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-10 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:98-101 auto Matches = match(findAll(declStmt(has(varDecl(equalsNode( .bind("declStmt")), +Body, Context);

[PATCH] D103565: Fix "control reaches end of non-void function" warnings on ppc64le

2021-06-02 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 rGb2c8bcbab8a4: Fix control reaches end of non-void function warnings on ppc64le (authored by zhaomo, committed by ymandel). Changed prior to commit:

[PATCH] D103565: Fix "control reaches end of non-void function" warnings on ppc64le

2021-06-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Actually, the removal of the default case in the switch gives this warning: ...llvm-project/clang/lib/ASTMatchers/GtestMatchers.cpp:102:11: warning: enumeration value 'Assert' not handled in switch [-Wswitch] I'll reinstate the default case before comitting the patch.

[PATCH] D103565: Fix "control reaches end of non-void function" warnings on ppc64le

2021-06-02 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! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103565/new/ https://reviews.llvm.org/D103565

[PATCH] D103195: Add matchers for gtest's ASSERT_THAT, EXPECT_THAT, ON_CALL and EXPECT_CALL

2021-06-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd0e159334f9d: Add matchers for gtests ASSERT_THAT, EXPECT_THAT, ON_CALL and EXPECT_CALL (authored by zhaomo, committed by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D103087: [clang-tidy] performances-unnecessary-* checks: Extend isOnlyUsedAsConst to expressions and catch const methods returning non-const references/pointers.

2021-06-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. I have some concerns about the cost of this checks as it used matching over entire contexts quite extensively. At this point, the facilities involved seem quite close to doing dataflow analysis and I wonder if you might be better off with a very different

[PATCH] D103021: [clang-tidy] performance-unnecessary-copy-initialization: Search whole function body for variable initializations.

2021-06-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp:97 + // Search the whole function body for decl statements of the initialization + // variable not just the current block statement. auto Matches =

[PATCH] D102175: [clang-tidy] performance-unnecessary-copy-initialization: Remove the complete statement when the copied variable is unused.

2021-06-02 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/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp:541 Orig.constMethod(); + UnnecessaryCopy.constMethod(); }

[PATCH] D103195: Add matchers for gtest's ASSERT_THAT, EXPECT_THAT, ON_CALL and EXPECT_CALL

2021-06-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. Nice! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103195/new/ https://reviews.llvm.org/D103195 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D103195: Add matchers for gtest's ASSERT_THAT, EXPECT_THAT, ON_CALL and EXPECT_CALL

2021-05-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang/include/clang/ASTMatchers/GtestMatchers.h:55-59 +/// Matcher for gtest's `ON_CALL` macro. When `Args` is `NoMatchers`, +/// this matches a mock call to a method without argument matchers e.g. +/// `ON_CALL(mock, TwoParamMethod)`;

[PATCH] D102175: [clang-tidy] performance-unnecessary-copy-initialization: Remove the complete statement when the copied variable is unused.

2021-05-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Hi Felix, Can you clarify your concern over the warning? Is it the case that the warning is not present before the fix and is only triggered after the fix? I'm concerned that removing the call may have unintended side effects and I would think it might better to leave

[PATCH] D102185: Widen `name` stencil to support `TypeLoc` nodes.

2021-05-11 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. Nice, thanks! In D102185#2749279 , @steveire wrote: > Adding Yitzhak as a reviewer. I notice that at least the name of a > cxxBaseSpecifier is not

[PATCH] D99543: [clang-tidy] Allow opt-in or out of some commonly occuring patterns in NarrowingConversionsCheck.

2021-04-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/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst:51 + + Narrowing conversions from any type in this semicolon

[PATCH] D100450: [libTooling] Add smart pointer support to the `access` Stencil

2021-04-14 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! Comment at: clang/unittests/Tooling/StencilTest.cpp:410 + StringRef Id = "id"; + testExpr(Id, Snippet, access(Id, "field"), "(*x).field"); +}

[PATCH] D99543: [clang-tidy] Allow opt-in or out of some commonly occuring patterns in NarrowingConversionsCheck.

2021-04-13 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. But please wait for additional "Accept" from either `hokein` or `aaron.ballman`. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D98738: [clang-tidy] performance-* checks: Match AllowedTypes against qualified type names when they contain "::".

2021-03-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:60 + return RegexAndScope{ + .Regex = llvm::Regex(Name), + .MatchQualifiedName = Name.contains("::"), I

[PATCH] D98738: [clang-tidy] performance-* checks: Match AllowedTypes against qualified type names when they contain "::".

2021-03-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:56 +if (Name.find("::") != std::string::npos) { + return llvm::Regex(Name).match(Node.getQualifiedNameAsString()); +} flx wrote: > ymandel wrote: > > flx wrote:

[PATCH] D98738: [clang-tidy] performance-* checks: Match AllowedTypes against qualified type names when they contain "::".

2021-03-17 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:56 +if (Name.find("::") != std::string::npos) { + return llvm::Regex(Name).match(Node.getQualifiedNameAsString()); +} flx wrote: > ymandel wrote: > > nit: while

[PATCH] D98738: [clang-tidy] performance-* checks: Match AllowedTypes against qualified type names when they contain "::".

2021-03-17 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. (but please wait for "accept" from an owner). Comment at: clang-tools-extra/clang-tidy/utils/Matchers.h:56 +if (Name.find("::") != std::string::npos) { + return

[PATCH] D96224: [clang-itdy] Simplify virtual near-miss check

2021-02-25 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D96224#2581501 , @njames93 wrote: > Can you take a look at https://llvm.org/PR49330, I'm guessing this patch > introduced this regression. +1 We've had to disable the check in the meantime. Repository: rG LLVM Github

[PATCH] D96542: [clang-tidy] Fix `TransformerClangTidyCheck`'s handling of include insertions.

2021-02-18 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp:108 + Diag << Inserter.createIncludeInsertion( + Result.SourceManager->getFileID(T.Range.getBegin()), T.Replacement); break; alexfh

[PATCH] D96542: [clang-tidy] Fix `TransformerClangTidyCheck`'s handling of include insertions.

2021-02-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG33f35a4b793b: [clang-tidy] Fix `TransformerClangTidyCheck`s handling of include insertions. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D96542: [clang-tidy] Fix `TransformerClangTidyCheck`'s handling of include insertions.

2021-02-11 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: alexfh. Herald added a subscriber: xazax.hun. ymandel requested review of this revision. Herald added a project: clang. Currently, all include insertions are directed to the main file. However, Transformer rules can specify alternative

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

2021-01-14 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 rG1fabe6e51917: [libTooling] Change `addInclude` to use expansion locs. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D94453: [clang-tidy][NFC] Add test for Transformer-based checks with diagnostics.

2021-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG922a5b894114: [clang-tidy] Add test for Transformer-based checks with diagnostics. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D94453: [clang-tidy][NFC] Add test for Transformer-based checks with diagnostics.

2021-01-12 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Reworked, per our discussion. PTAL. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94453/new/ https://reviews.llvm.org/D94453 ___ cfe-commits mailing list

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