[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-06 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 121740. barancsuk marked 2 inline comments as done. barancsuk added a comment. Address review comments: fix missing full stops at the end of comments https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:41 +static const llvm::StringSet<> KnownBannedMacroNames = {"EAGAIN", "EWOULDBLOCK", + "SIGCLD", "SIGCHLD"};

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-11-02 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 121323. barancsuk added a comment. Fix shifted line https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp clang-tidy/misc/RedundantExpressionCheck.h docs/clang-tidy/checks/misc-redundant-expression.rst

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:633-635 +// The function discards (X < M1 && X <= M2), because it can always be +// simplified to X < M, where M is the smaller one of the two macro +// values.

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-30 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 120820. barancsuk marked 17 inline comments as done. barancsuk added a comment. Address review comments, discard ambiguously redundant macro expressions https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-18 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/misc/RedundantExpressionCheck.cpp:510 +// E.g.: from (X == 5) && (X == 5) retrieves 5 and 5 +static void retrieveConstExprFromBothSides(const BinaryOperator *, + BinaryOperatorKind

[PATCH] D38688: [clang-tidy] Misc redundant expressions checker updated for macros

2017-10-18 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 119452. barancsuk marked 8 inline comments as done. barancsuk added a comment. Herald added a subscriber: whisperity. Address review comments. https://reviews.llvm.org/D38688 Files: clang-tidy/misc/RedundantExpressionCheck.cpp

[PATCH] D38688: Misc redundant expressions checker updated for macros

2017-10-09 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk created this revision. barancsuk added a project: clang-tools-extra. Redundant Expression Checker is updated to be able to detect expressions that contain macro constants. Also, other small details are modified to improve the current implementation. The improvements in detail are as

[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-10-06 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added a comment. @alexfh, have you had a chance to look at the results yet? https://reviews.llvm.org/D20689 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-09-22 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added a comment. I attached the results of the tests. The warnings are categorized into false positives and renaming opportunities. F5376033: PostgreSQL F5376032: FFmpeg F5376031: LLVM

[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-09-15 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added a comment. @alexfh, would you mind taking a look at the changes that have been introduced in the new patch? The main improvements are: - The checker has been shifted to the module `readability`. - It is checked, whether implicit type conversion is possible from the argument to

[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-09-05 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 113830. barancsuk added a comment. Check if argument and parameter numbers differ, add test cases for functions with default parameters https://reviews.llvm.org/D20689 Files: clang-tidy/readability/CMakeLists.txt

[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-08-31 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 113376. barancsuk added a comment. Major changes that have been made since the last update are as follows: - It is checked, whether implicit type conversion is possible from the argument to the other parameter. The following conversion rules are

[PATCH] D20689: [clang-tidy] Suspicious Call Argument checker

2017-08-31 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk commandeered this revision. barancsuk added a reviewer: varjujan. barancsuk added a comment. Herald added a subscriber: baloghadamsoftware. Since the previous author, @varjujan is not available anymore, I take over the role of the author of this revision.

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-08-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk marked 3 inline comments as done. barancsuk added inline comments. Comment at: test/clang-tidy/readability-static-accessed-through-instance.cpp:55 + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: static member accessed through + // instance

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-08-08 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp:23 + memberExpr(hasDeclaration(anyOf(cxxMethodDecl(isStaticStorageClass()), + varDecl(hasStaticStorageDuration(, +

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-08-08 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 110175. barancsuk marked 4 inline comments as done. barancsuk added a comment. Further reviews addressed https://reviews.llvm.org/D35937 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ReadabilityTidyModule.cpp

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-08-01 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/readability/StaticAccessedThroughInstanceCheck.cpp:23 + memberExpr(hasDeclaration(anyOf(cxxMethodDecl(isStaticStorageClass()), + varDecl(hasStaticStorageDuration(, +

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-08-01 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 109120. barancsuk marked 7 inline comments as done. barancsuk added a comment. Address review comments https://reviews.llvm.org/D35937 Files: clang-tidy/readability/CMakeLists.txt clang-tidy/readability/ReadabilityTidyModule.cpp

[PATCH] D35937: [clang-tidy] Add new readability non-idiomatic static access

2017-07-27 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk created this revision. barancsuk added a project: clang-tools-extra. Herald added subscribers: baloghadamsoftware, xazax.hun, whisperity, JDevlieghere, mgorny. Checks for member expressions that access static members through instances, and replaces them with the corresponding

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: test/clang-tidy/modernize-unary-static-assert.cpp:16 + // CHECK-FIXES: {{^}} FOO{{$}} + static_assert(sizeof(a) <= 17, MSG); + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: use unary 'static_assert' when

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106195. barancsuk marked 4 inline comments as done. barancsuk added a comment. - No longer warn when the message is from a macro expansion https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk added inline comments. Comment at: clang-tidy/modernize/UnaryStaticAssertCheck.cpp:32 + + if (!AssertMessage || AssertMessage->getLength()) +return; aaron.ballman wrote: > I think this should be `!AssertMessage->getLength()` It works correctly

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-12 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106148. barancsuk marked 2 inline comments as done. barancsuk added a comment. - Further reviews addressed https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106026. barancsuk added a comment. - Missed some fixes last time https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UnaryStaticAssertCheck.cpp

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106025. barancsuk marked 10 inline comments as done. barancsuk added a comment. - Address review comments https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk updated this revision to Diff 106021. barancsuk added a comment. - Do not rewrite macro expansions https://reviews.llvm.org/D35257 Files: clang-tidy/modernize/CMakeLists.txt clang-tidy/modernize/ModernizeTidyModule.cpp clang-tidy/modernize/UnaryStaticAssertCheck.cpp

[PATCH] D35257: [clang-tidy] Add new modernize use unary assert check

2017-07-11 Thread Barancsuk Lilla via Phabricator via cfe-commits
barancsuk created this revision. barancsuk added a project: clang-tools-extra. Herald added subscribers: xazax.hun, JDevlieghere, mgorny. The check finds `static_assert` declarations with empty messages, and replaces them with an unary `static_assert` declaration. The check is only applicable