[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-22 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: xazax.hun, LegalizeAdulthood. zinovy.nis added a project: clang-tools-extra. Herald added subscribers: cfe-commits, rnkovacs. It's useless and not safe to replace `"\xE2\x98\x83"` with `"☃"` (snowman) Especially there's an explicit te

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-22 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: test/clang-tidy/modernize-raw-string-literal.cpp:42 char const *const HexNonPrintable("\\\x03"); char const *const Delete("\\\177"); +char const *const MultibyteSnowman("\xE2\x98\x83"); By the way, AFAIK the lines a

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-23 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: clang-tidy/modernize/RawStringLiteralCheck.cpp:70-72 + if (Bytes.find_if([](char C) { +return static_cast(C) > 0x7Fu; + }) != StringRef::npos) aaron.ballman w

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-23 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 143679. zinovy.nis marked an inline comment as done. zinovy.nis added a comment. - Use clang::isASCII instead of home-brewed code. https://reviews.llvm.org/D45932 Files: clang-tidy/modernize/RawStringLiteralCheck.cpp test/clang-tidy/modernize-raw-str

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-24 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize/RawStringLiteralCheck.cpp:71 + // supported by specific code pages only. + if (Bytes.find_if_not(isASCII) != StringRef::npos) +return false; aaron.ballman wrote: > I am starting to think tha

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-24 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize/RawStringLiteralCheck.cpp:71 + // supported by specific code pages only. + if (Bytes.find_if_not(isASCII) != StringRef::npos) +return false; aaron.ballman wrote: > zinovy.nis wrote: > > aaro

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-24 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize/RawStringLiteralCheck.cpp:71 + // supported by specific code pages only. + if (Bytes.find_if_not(isASCII) != StringRef::npos) +return false; aaron.ballman wrote: > zinovy.nis wrote: > > aaro

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-25 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 144066. zinovy.nis added a comment. - Optimized `containsEscapedCharacters` not to re-create `bitset` (implicitly in `StringRef::find_first_of`) for each literal. - Merged 2 passes for testing for allowed chars into a single one. https://reviews.llvm.org

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-04-27 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Aaron, any comments for the new revision? https://reviews.llvm.org/D45932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Gentle ping. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45927 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize/UseAutoCheck.cpp:33 + +bool IsNotSpace(const char& C) { + return !std::isspace(static_cast(C)); alexfh wrote: > Why `const char&` and not just `char`? Moreover, these two functions can be > repl

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-04-30 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. > I think, it's 13, if you choose to remove stars, and 17 otherwise. The > difference is excessive spaces vs. required ones. Implementing proper logic > may be involved, but we can simplify it to something like "count all > non-space characters and a single space bet

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Gentle ping. https://reviews.llvm.org/D45932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 144727. zinovy.nis added a comment. - Applied Alexander's changes. https://reviews.llvm.org/D45927 Files: clang-tidy/checks/modernize-use-auto.rst clang-tidy/modernize-use-auto-min-type-name-length.cpp modernize/UseAutoCheck.cpp Index: clang-tidy/

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize/RawStringLiteralCheck.cpp:111 + // Upper ASCII are disallowed too. + for (unsigned char C = 0xFFu; C >= 0x80u; --C) +DisallowedChars.set(C); LegalizeAdulthood wrote: > Why does this loop go

[PATCH] D46325: [clang-tidy] Define __clang_analyzer__ macro for clang-tidy for compatibility with clang static analyzer. 2nd try.

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: george.karpenkov, alexfh, hokein. zinovy.nis added a project: clang-tools-extra. Herald added subscribers: cfe-commits, a.sidorin, xazax.hun. This macro is widely used in many well-known projects, ex. Chromium. But it's not set for cla

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: test/clang-tidy/modernize-raw-string-literal.cpp:44 +char const *const MultibyteSnowman("\xE2\x98\x83"); +// CHECK-FIXES: {{^}}char const *const MultibyteSnowman("\xE2\x98\x83");{{$}} ---

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis closed this revision. zinovy.nis added a comment. Fixed in git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@331297 91177308-0d34-0410-b5e6-96231b3b80d8 https://reviews.llvm.org/D45932 ___ cfe-commits mailing list c

[PATCH] D45932: [clang-tidy][modernize-raw-string-literal] Don't replace upper ASCII with raw literals

2018-05-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. https://reviews.llvm.org/rCTE331297 https://reviews.llvm.org/D45932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46325: [clang-tidy] Define __clang_analyzer__ macro for clang-tidy for compatibility with clang static analyzer. 2nd try.

2018-05-03 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 145059. zinovy.nis added a comment. - Added comments on why setting `ProgramAction` explicitly. https://reviews.llvm.org/D46325 Files: clang-tidy/ClangTidy.cpp test/clang-tidy/clang-tidy-__clang_analyzer__macro.cpp Index: test/clang-tidy/clang-tidy

[PATCH] D46325: [clang-tidy] Define __clang_analyzer__ macro for clang-tidy for compatibility with clang static analyzer. 2nd try.

2018-05-03 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Thanks Alexander for your feedback! https://reviews.llvm.org/D46325 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46325: [clang-tidy] Define __clang_analyzer__ macro for clang-tidy for compatibility with clang static analyzer. 2nd try.

2018-05-03 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331474: [clang-tidy] Define __clang_analyzer__ macro for clang-tidy for compatibility… (authored by zinovy.nis, committed by ). Herald added subscribers: llvm-commits, klimek. Changed prior to commit: h

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-05 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +// CHECK-FIXES-0-5: auto li = {{.*}} +// CHECK-FIXES-1-0: auto li = {{.*}} +//

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-06 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +// CHECK-FIXES-0-5: auto li = {{.*}} +// CHECK-FIXES-1-0: auto li = {{.*}} +//

[PATCH] D45927: [clang-tidy] [modernize-use-auto] Correct way to calculate a type name length for multi-token types

2018-05-06 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tidy/modernize-use-auto-min-type-name-length.cpp:61-83 +long int li = static_cast(foo()); +// CHECK-FIXES-0-0: auto li = {{.*}} +// CHECK-FIXES-0-5: auto li = {{.*}} +// CHECK-FIXES-1-0: auto li = {{.*}} +//

[PATCH] D80536: [clang-tidy][modernize-loop-convert] Make loop var type human readable

2020-05-25 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: angelgarcia, alexfh. zinovy.nis added a project: clang-tools-extra. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. zinovy.nis edited the summary of this revision. Without this patch for(std::set::ite

[PATCH] D80536: [clang-tidy][modernize-loop-convert] Make loop var type human readable

2020-05-26 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D80536#2055500 , @njames93 wrote: > I'm having trouble with the reproduction of this - > https://godbolt.org/z/tsMfcj. > Aside from that this needs some test cases to demonstrate the patch is > indeed working Thanks. See

[PATCH] D80536: [clang-tidy][modernize-loop-convert] Make loop var type human readable

2020-05-29 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Nathan, do you have any other questions/comments? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80536/new/ https://reviews.llvm.org/D80536 ___ cfe-commits mailing list cfe-c

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Fix crash on CXXFoldExpr

2020-05-31 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added a reviewer: etienneb. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. Fix for a crash from https://bugs.llvm.org/show_bug.cgi?id=44256 Bug: https://bugs.llvm.org/show_bug.cgi?id=44256 Repository: rG LLVM Githu

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Fix crash on CXXFoldExpr

2020-05-31 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 267518. zinovy.nis added a comment. Fix formatting. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80896/new/ https://reviews.llvm.org/D80896 Files: clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp clang-tools-extra/test/clang-t

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Fix crash on CXXFoldExpr

2020-05-31 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 267546. zinovy.nis added a comment. Fix and simplify the condition. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80896/new/ https://reviews.llvm.org/D80896 Files: clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp clang-tools-ex

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked 2 inline comments as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-redundant-expression.cpp:18 +namespace no_crash { +struct Foo {}; I had to move this up as no warnings were generated in

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 267565. zinovy.nis added a comment. - Fix test. - Simplify the code. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80896/new/ https://reviews.llvm.org/D80896 Files: clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp clang-tools-e

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-01 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. @njames93, do you still have any comments? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80896/new/ https://reviews.llvm.org/D80896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-04-05 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 255128. zinovy.nis added a comment. Rebase over the current master. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 Files: clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp clang-tools-extra

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-04 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. @njames93, @aaron.ballman do you have any other comments? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80896/new/ https://reviews.llvm.org/D80896 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[PATCH] D80536: [clang-tidy][modernize-loop-convert] Make loop var type human readable

2020-06-04 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6271b96bef47: [clang-tidy][modernize-loop-convert] Make loop var type human readable (authored by zinovy.nis). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-04 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 268527. zinovy.nis added a comment. Simplify test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80896/new/ https://reviews.llvm.org/D80896 Files: clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp clang-tools-extra/test/clang-ti

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-04 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/misc-redundant-expression.cpp:196 bool operator>(const MyStruct& lhs, MyStruct& rhs) { rhs.x--; return lhs.x > rhs.x; } bool operator||(MyStru

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-05 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc063b4a72bb3: Fix crash on misc-redundant-expression (authored by zinovy.nis). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80896/new/ https://reviews.llvm

[PATCH] D80896: [clang-tidy][misc-redundant-expression] Support for CXXFoldExpr

2020-06-05 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D80896#2076735 , @njames93 wrote: > How are you landing these changes, because the commit message isn't lining up > with the PR name? It was my fault: I hadn't changed a title in my local branch and pushed it with git.

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-04-21 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. One more gentle ping) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[PATCH] D57662: [clang-tidy] Parallelize clang-tidy-diff.py

2019-12-29 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D57662#1797607 , @derek wrote: > @zinovy.nis @alexfh @JonasToth @MyDeveloperDay > > I'd be happy to provide a patch. It would be nice, thanks! Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://revi

[PATCH] D87627: [clang-tidy] Fix crash in modernize-use-noexcept on uninstantiated throw class

2020-09-14 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: alexfh, rsmith. zinovy.nis added a project: clang-tools-extra. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. zinovy.nis requested review of this revision. Bug: https://bugs.llvm.org/show_bug.cgi?id=474

[PATCH] D87627: [clang-tidy] Fix crash in modernize-use-noexcept on uninstantiated throw class

2020-09-15 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 291971. zinovy.nis marked 2 inline comments as done. zinovy.nis added a comment. - Fixed the test. - Fixed clang-format issues. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87627/new/ https://reviews.llvm.org/D87627 Files: clang-tools-extra/c

[PATCH] D87627: [clang-tidy] Fix crash in modernize-use-noexcept on uninstantiated throw class

2020-09-15 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87627/new/ https://reviews.llvm.org/D87627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D87627: [clang-tidy] Fix crash in modernize-use-noexcept on uninstantiated throw class

2020-09-15 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG96c6d012dfe2: [clang-tidy] Fix crash in modernize-use-noexcept on uninstantiated throw class (authored by zinovy.nis). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D91495: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of passed-by-ref params

2020-12-11 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG709112bce442: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of… (authored by zinovy.nis). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D91037: [clang-tidy][bugprone-use-after-mnove] Warn on std::move for consts

2020-11-08 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang. zinovy.nis requested review of this revision. Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups. Bug: https://bugs.llvm.org/show_bug.cgi?id=48008. Repository: r

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-08 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D91037#2381606 , @njames93 wrote: > Think this has an incorrect name, seems to have something to do with > `bugprone-redundant-branch-condition` Oops, thanks to autofill. Fixed. Repository: rG LLVM Github Monorepo CHAN

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-08 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 303750. zinovy.nis edited the summary of this revision. zinovy.nis added a comment. auto -> const auto. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new/ https://reviews.llvm.org/D91037 Files: clang-tools-extra/clang-tidy/bugprone/Redun

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 304242. zinovy.nis marked 2 inline comments as done. zinovy.nis added a comment. *iterator -> getSubExpr() CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new/ https://reviews.llvm.org/D91037 Files: clang-tools-extra/clang-tidy/bugprone/Re

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done and 2 inline comments as not done. zinovy.nis added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:85 // remove the inner `if`. - const auto *BinOpCond = dyn_cast(InnerIf->getCo

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked 2 inline comments as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:85 // remove the inner `if`. - const auto *BinOpCond = dyn_cast(InnerIf->getCond()); + const auto *BinOpCond =

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 304280. zinovy.nis added a comment. dyn_cast_or_null -> dyn_cast CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new/ https://reviews.llvm.org/D91037 Files: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp clang-t

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:85 // remove the inner `if`. - const auto *BinOpCond = dyn_cast(InnerIf->getCond()); + const auto *BinOpCond =

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 304400. zinovy.nis added a comment. Simplified to use `IgnoreImplicit()`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new/ https://reviews.llvm.org/D91037 Files: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked 2 inline comments as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:145 + const auto *LeftDRE = dyn_cast(CondOp->getLHS()->IgnoreParenImpCasts()); aaron.

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added a comment. In D91037#2387377 , @njames93 wrote: > Taking a step back, rather than worrying about if its an `ExprWithCleanups`. > Shouldn't we just get the condition removing all implicit nodes.

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 304561. zinovy.nis added a comment. Use `IgnoreParenImpCasts` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new/ https://reviews.llvm.org/D91037 Files: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp clang-tool

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp:45 ifStmt( hasCondition(ignoringParenImpCasts(anyOf( declRefExpr(hasDeclaration(Imm

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:1092 + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant condition 'isSet' [bugprone-redundant-

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 304719. zinovy.nis added a comment. Fixed fix-it section. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new/ https://reviews.llvm.org/D91037 Files: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp clang-tools-ex

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-12 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:1092 + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant condition 'isSet' [bugprone-redundant-branch-condition] + // CHECK-FIXES: {{is

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-12 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:1092 + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant condition 'isSet' [bugprone-redundant-

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-13 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4364539b3a4c: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on… (authored by zinovy.nis). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-13 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D91037#2391915 , @aaron.ballman wrote: > LGTM! Thanks! I'll see what can be done to deal with it in a separate commit. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91037/new

[PATCH] D91037: [clang-tidy] Fix crash in bugprone-redundant-branch-condition on ExprWithCleanups

2020-11-15 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:1092 + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: redundant condition 'isSet' [bugprone-redundant-branch-condition] + // CHECK-FIXES: {{is

[PATCH] D91495: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of passed-by-ref params

2020-11-15 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: aaron.ballman, baloghadamsoftware. Herald added subscribers: cfe-commits, rnkovacs, xazax.hun. Herald added a project: clang. zinovy.nis requested review of this revision. Inspired by discussion in https://reviews.llvm.org/D91037 Repo

[PATCH] D91495: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of passed-by-ref params

2020-11-15 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 305361. zinovy.nis added a comment. Extend the context. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91495/new/ https://reviews.llvm.org/D91495 Files: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp clang-tools-extr

[PATCH] D91495: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of passed-by-ref params

2020-11-18 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-redundant-branch-condition.cpp:968 + } +} + aaron.ballman wrote: > Another test that would be interesting is: > ``` > if (tryToExtinguish(isSet) && isSet) { > if

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-10 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. Herald added subscribers: cfe-commits, lebedev.ri, xazax.hun. Herald added a reviewer: lebedev.ri. Herald added a project: clang. zinovy.nis requested review of this revision. Assert fires on weak refs like static void dont_crash_on_weak() __attribute__((__weakr

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 297458. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://reviews.llvm.org/D89194 Files: clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp clang-tools-extra/test/clang-tidy/checkers/readability-funct

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 297462. zinovy.nis added a comment. - Updated docs on the matcher. - Register the new matcher. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://reviews.llvm.org/D89194 Files: clang-tools-extra/clang-tidy/readability/FunctionCog

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Done. Any other comments/ideas? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://reviews.llvm.org/D89194 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 297463. zinovy.nis added a comment. Full diff. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://reviews.llvm.org/D89194 Files: clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp clang-tools-extra/t

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D89194#2323868 , @JonasToth wrote: > LGTM. > Short reminder to please use full context patches. Its not an issue right > now, but review sometimes just needs the context to understand the changes :) Sorry. Done.

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 297468. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://reviews.llvm.org/D89194 Files: clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp clang-tools-extra/test/clang-tidy/checkers/readability-funct

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D89194#2323917 , @JonasToth wrote: > I am fine now, thank you! Thanks! Is this patch ready for landing? Or should I wait for a few more approvals? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89194/new/ https://

[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

2020-10-11 Thread Zinovy Nis via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG32d565b4618d: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs (authored by zinovy.nis). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D91495: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of passed-by-ref params

2020-11-25 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 307646. zinovy.nis added a comment. Handle ref & val mixed cases. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91495/new/ https://reviews.llvm.org/D91495 Files: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp clang-

[PATCH] D91495: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of passed-by-ref params

2020-11-29 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. What do you think of it? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91495/new/ https://reviews.llvm.org/D91495 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D91495: [clang-tidy] false-positive for bugprone-redundant-branch-condition in case of passed-by-ref params

2020-12-05 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 309732. zinovy.nis added a comment. Fixed remarks from Aaron. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91495/new/ https://reviews.llvm.org/D91495 Files: clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp clang-tool

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-24 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Gentle ping) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[PATCH] D74692: [clang-tidy] Make bugprone-use-after-move ignore std::move for const values

2020-02-20 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D74692#1884054 , @Quuxplusone wrote: > (I sent this to the mailing list, but I guess it doesn't show up here unless > I do it through Phab. Quoting myself—) > > I see your point about how users who care should always be pass

[PATCH] D75021: [clang][analyzer] Enable core.builtin even with -no-default-checks

2020-02-23 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: abdulras, xazax.hun. zinovy.nis added a project: clang. Herald added subscribers: cfe-commits, Charusso, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. It's required to properly handle

[PATCH] D74692: [clang-tidy] Make bugprone-use-after-move ignore std::move for const values

2020-02-25 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 246628. zinovy.nis added a comment. Warning on use after move is still generated. But there's also an additional note > std::move of the const expression has no effect; remove std::move() or make > the variable non-const CHANGES SINCE LAST ACTION h

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-02-26 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked an inline comment as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-use-after-move.cpp:329 // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here + // CHECK-NOTES: [[@LINE-6]]:7: note: std::m

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-03 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 247982. zinovy.nis added a comment. 1. Special handling for captured variables in lambdas, 2. messages texts were changed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 Files: clang-tools-extra/clang-

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-03 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 247985. zinovy.nis added a comment. Typo fixed. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 Files: clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp clang-tools-extra/test/clang-tidy/che

[PATCH] D69746: [analyzer] FixItHint: Apply and test hints with the Clang Tidy's script

2019-11-03 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:152 + + if (llvm::Error Err = Repls.add(Repl)) +llvm_unreachable("An error occured during fix-it replacements"); Isn't `llvm_unreacheable` to

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-06 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. Any further comments? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-07 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 248905. zinovy.nis marked 4 inline comments as done. zinovy.nis added a comment. Cosmetic and style fixes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 Files: clang-tools-extra/clang-tidy/bugprone/Us

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-07 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-use-after-move.cpp:342 + // CHECK-NOTES: [[@LINE-5]]:20: note: variable 'a' implicitly captured const here }; } aaron.ballman wrote: > One more test c

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-08 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D74692#1911150 , @Quuxplusone wrote: > Anyway, I still don't see the point of this patch. It seems like you're just > duplicating the work of `performance-move-const-arg`. People who want to be > shown notes about moves-of-

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-08 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis marked 2 inline comments as done. zinovy.nis added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/bugprone-use-after-move.cpp:342 + // CHECK-NOTES: [[@LINE-5]]:20: note: variable 'a' implicitly captured const here }; } --

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-11 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. I'm done, Aaron, Quuxplusone, do you have any comments? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-14 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis updated this revision to Diff 250375. zinovy.nis added a comment. Removed top-level consts. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74692/new/ https://reviews.llvm.org/D74692 Files: clang-tools-extra/clang-tidy/bugprone/UseAfterMoveCheck.cpp clang-tools-extra/test/

[PATCH] D74692: [clang-tidy][bugprone-use-after-move] Warn on std::move for consts

2020-03-15 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis added a comment. In D74692#1923191 , @Quuxplusone wrote: > I still think this entire patch is misguided; there's no reason to make the > note for `const std::string s; std::move(s)` any longer than the note for > `int i; std::move(i)` or `vola

[PATCH] D74692: [clang-tidy] Make bugprone-use-after-move ignore std::move for const values

2020-02-16 Thread Zinovy Nis via Phabricator via cfe-commits
zinovy.nis created this revision. zinovy.nis added reviewers: mboehme, alexfh. zinovy.nis added a project: clang-tools-extra. Herald added subscribers: cfe-commits, mgehre, xazax.hun. Herald added a project: clang. std::move for const values is NO-OP, so it has no sense to report it in bugprone-u

<    1   2   3   >