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

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

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

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

[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(&InitializingVar .bind("declStmt")), +Body

[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(&InitializingVar .bind("declStmt")), +Body

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

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

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

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

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

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

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

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

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

[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. mayb

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

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

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

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

[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 Loc.getLocWithOff

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

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

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

[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] 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-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 cfe-com

[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, capturesVa

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

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

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

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

[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 &WorkingDir = SM.getFileManager().getFileSystemOpts().WorkingDir; +auto PrevWorkingDir = WorkingDir; ---

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

[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 &Capture : Node.captures()) { +if (Finder->isTraversalIgnoringImplicitNodes() && C

[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 + hasSourceExpression(StringV

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

[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] 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 User:

[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-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 clang/docs/i

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

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

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

[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; ``` Repository

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

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

[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] 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: clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp:

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

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

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

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

[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 it's

[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. Demo patch here: https://reviews.llvm.org/D114981. Still needs fixes to the tests and any potential plumbing from flags in clang-tidy main. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108560/new/ https://reviews.llvm.org

[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. Thanks, all, for the prompt response to these concerns!! In D108560#3167847 , @salman-javed-nz wrote: > Thanks for the investigation. Just exploring the options... > > With regards to reverting it, is the cat out of the bag? I a

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

2021-12-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 391450. ymandel added a comment. change to "enabled-by-default" Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114981/new/ https://reviews.llvm.org/D114981 Files: clang-tools-extra/clang-tidy/ClangTidyDiagnos

[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. Update: I modified https://reviews.llvm.org/D114981 to leave it enabled by default. That makes it essentially an NFC while still allowing clients to disable it easily in tooling that uses it. We can still disable by default, but that will be a separate patch from adding

[PATCH] D114981: [clang-tidy] Allow disabling support for NOLINTBEGIN/NOLINTEND blocks.

2021-12-02 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 391455. ymandel added a comment. remove incorrect line in comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114981/new/ https://reviews.llvm.org/D114981 Files: clang-tools-extra/clang-tidy/ClangTidyDiagn

[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. In D108560#3168182 , @salman-javed-nz wrote: > Update: OK I see you have already changed your patch to make the feature > enabled by default. > As far as the performance is concerned, I will have a go at improving it and > hope

[PATCH] D114981: [clang-tidy] Allow disabling support for NOLINTBEGIN/NOLINTEND blocks.

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 rG081074e1ea53: [clang-tidy] Allow disabling support for NOLINTBEGIN/NOLINTEND blocks. (authored by ymandel). Repository: rG LLVM Github Monorepo C

[PATCH] D115121: Add support for return values in bugprone-stringview-nullptr

2021-12-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/StringviewNullptrCheck.cpp:75 - auto HandleTemporaryCXXStaticCastExpr = makeRule( - cxxStaticCastExpr( - hasSourceExpression(StringViewConstructingFromNullExpr)), - changeTo(nod

[PATCH] D135964: [clang][dataflow] Add equivalence relation for `Value` type.

2022-10-19 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 468884. ymandel marked an inline comment as done. ymandel added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135964/new/ https://reviews.llvm.org/D135964 Files: clang/include/cla

[PATCH] D135964: [clang][dataflow] Add equivalence relation for `Value` type.

2022-10-19 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 rG8cadac41e9f6: [clang][dataflow] Add equivalence relation `Value` type. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D133698: [clang][dataflow] Implement transferBranch

2022-10-25 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. Overall, looks quite good. Comment at: clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h:87-88 + /// Applies the analysis transfer funct

[PATCH] D136668: [clang][dataflow] Add initial sign analysis

2022-10-25 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!! Just nits. At a high level, I'm a little concerned about this as a demo, since I wouldn't recommend this implementation in practice (for various reasons, e.g. I would encode with 2

[PATCH] D133698: [clang][dataflow] Implement transferBranch

2022-10-26 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/Analysis/FlowSensitive/TransferBranchTest.cpp:73 + .getName())}), + /*VerifyResults=*/Match),

[PATCH] D136797: [clang-tidy] Skip template ctors in modernize-use-equals-default

2022-10-26 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/UseEqualsDefaultCheck.cpp:249 unless(isVariadic()), parameterCountIs(0), +un

[PATCH] D136797: [clang-tidy] Skip template ctors in modernize-use-equals-default

2022-10-27 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added inline comments. Comment at: clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp:249 unless(isVariadic()), parameterCountIs(0), +unless(hasParent(functionTemplateDecl())), IsPublicOrOutOfLine

[PATCH] D131646: [clang][dataflow] Restructure loops to call widen on back edges

2022-08-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! Comment at: clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp:180 + assert(Block->pred_size() == 2); + BackEdge = Pred; +} ---

[PATCH] D131645: [clang][dataflow] Allow user-provided lattices to provide a widen operator

2022-08-11 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/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:119 + std::unique_ptr AST = + tooling::buildASTFromCodeWithArgs("int x = 0;

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: martong, rnkovacs. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Extend the context-sensitive analysis to hand

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 462153. ymandel added a comment. formatting Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134432/new/ https://reviews.llvm.org/D134432 Files: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp clang/

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 462263. ymandel added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134432/new/ https://reviews.llvm.org/D134432 Files: clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp clang/unit

[PATCH] D134432: [clang][dataflow] Add support for nested method calls.

2022-09-22 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG0b12efc7a42c: [clang][dataflow] Add support for nested method calls. (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134432/new/ https:

[PATCH] D130130: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in-decls

2022-09-30 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/ReleaseNotes.rst:108-111 +- The :doc:`readability-avoid-const-params-in-decls + ` check does not + warn about const value parameter

[PATCH] D130130: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in-decls

2022-09-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9a4e52ebeb6d: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in… (authored by ymandel). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D130130: [clang-tidy] Add an IgnoreMacros option to readability-avoid-const-params-in-decls

2022-09-30 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Note: fixed typo in doc in followup commit 40f5c634bc991510427e274ba49d4c56f29ef593 . Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130130/new/ https://

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-06 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev. Herald added subscribers: martong, rnkovacs. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Currently, our boolean formulas (`BoolValue`)

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Thanks for the thorough reviews! Agreed on all points, and will address. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:157 + TopValue &createTop() { +return takeOwnership(std::make_unique()); + } ---

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 466124. ymandel marked an inline comment as done. ymandel added a comment. Address (most) comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files: clang/inc

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-07 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 11 inline comments as done. ymandel added inline comments. Comment at: clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp:237-238 + case Value::Kind::Top: +// Nothing more to do. Each `Top` instance will be mapped to a fresh +// variabl

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467510. ymandel marked 6 inline comments as done. ymandel added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files: clang/include/cl

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467513. ymandel added a comment. Add explicit test for creation of multiple tops. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files: clang/include/clang/Analysi

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 5 inline comments as done. ymandel added inline comments. Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:157 + TopValue &createTop() { +return takeOwnership(std::make_unique()); + } xazax.hun wrote: > griboz

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467589. ymandel marked an inline comment as done. ymandel added a comment. added another test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files: clang/include/c

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467609. ymandel added a comment. Added FIXMEs for noted issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files: clang/include/clang/Analysis/FlowSensitive/Da

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked 6 inline comments as done. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp:527-528 +auto *Prop2 = Val2.getProperty("has_value"); +return Prop1 == Prop2 || (Prop1 != nullptr && Prop2 != nu

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467611. ymandel added a comment. fix typos Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext

[PATCH] D135923: [clang-dataflow][NFC] Mark test analysis classes as `final`.

2022-10-13 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added a reviewer: xazax.hun. Herald added a subscriber: rnkovacs. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Change from marking individual methods as `final` to marking the whole class. Repository

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel updated this revision to Diff 467746. ymandel marked an inline comment as done. ymandel added a comment. Adding back accidentally deleted test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135397/new/ https://reviews.llvm.org/D135397 Files

[PATCH] D135397: [clang][dataflow] Add support for a Top value in boolean formulas.

2022-10-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel marked an inline comment as done. ymandel added inline comments. Comment at: clang/unittests/Analysis/FlowSensitive/SolverTest.cpp:69 -TEST(SolverTest, UnitConflict) { - ConstraintContext Ctx; gribozavr2 wrote: > Why delete this test? That was a mistak

[PATCH] D135964: [clang][dataflow] Add `operator==` for `Value` type.

2022-10-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel created this revision. ymandel added reviewers: xazax.hun, sgatev, gribozavr2. Herald added subscribers: martong, rnkovacs. Herald added a reviewer: NoQ. Herald added a project: All. ymandel requested review of this revision. Herald added a project: clang. Defines `operator==` as an equiva

[PATCH] D135964: [clang][dataflow] Add `operator==` for `Value` type.

2022-10-14 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. Reviewers: I'm inclined towards a method vs overloaded operator. Please let me know. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135964/new/ https://reviews.llvm.org/D135964 _

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