https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/112101
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -9,8 +9,10 @@
#include "UseStartsEndsWithCheck.h"
#include "../utils/ASTUtils.h"
-#include "../utils/OptionsUtils.h"
+#include "../utils/Matchers.h"
+#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Lex/Lexer.h"
+#include "llvm/ADT/ArrayRef.h"
ni
nicovank wrote:
Rebase past 3484ed9325f30b56717a1b939af4c58dd07848e0 for green CI.
https://github.com/llvm/llvm-project/pull/112162
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -82,34 +84,25 @@ UseStartsEndsWithCheck::UseStartsEndsWithCheck(StringRef
Name,
void UseStartsEndsWithCheck::registerMatchers(MatchFinder *Finder) {
const auto ZeroLiteral = integerLiteral(equals(0));
- const auto HasStartsWithMethodWithName = [](const std::string &Name
@@ -82,34 +84,25 @@ UseStartsEndsWithCheck::UseStartsEndsWithCheck(StringRef
Name,
void UseStartsEndsWithCheck::registerMatchers(MatchFinder *Finder) {
const auto ZeroLiteral = integerLiteral(equals(0));
- const auto HasStartsWithMethodWithName = [](const std::string &Name
@@ -150,8 +150,8 @@ void test(std::string s, std::string_view sv, sub_string
ss, sub_sub_string sss,
// CHECK-FIXES: puv.starts_with("a");
puvf.find("a") == 0;
- // CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use starts_with
- // CHECK-FIXES: puvf.starts_with("a")
https://github.com/nicovank commented:
I like Mustache! Just took a quick look at this following your Discourse post.
Do the custom allocators make any significant performance difference (measure)?
Wouldn't want to prematurely optimize. They're the kind of thing that make
maintenance annoying
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/111472
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/108443
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/110448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nicovank wrote:
Sounds good, thanks! I will go ahead and rebase and merge this.
https://github.com/llvm/llvm-project/pull/110448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank created
https://github.com/llvm/llvm-project/pull/112051
Summary:
Test Plan:
>From 9b2953abd81dab3349a656544c916fe101508ff2 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Fri, 11 Oct 2024 17:45:35 -0400
Subject: [PATCH] [clang-tidy] Add new
performance
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/112051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/110448
>From 028d68178748806ce2318360260bdc1833b4f2b3 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Fri, 11 Oct 2024 17:44:47 -0400
Subject: [PATCH] [clang-tidy][modernize-use-starts-ends-with] Add support f
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/112051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/110448
>From 028d68178748806ce2318360260bdc1833b4f2b3 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Fri, 11 Oct 2024 17:44:47 -0400
Subject: [PATCH] [clang-tidy][modernize-use-starts-ends-with] Add support f
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/105366
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank created
https://github.com/llvm/llvm-project/pull/110448
Add support for the following two patterns:
```
haystack.compare(haystack.length() - needle.length(), needle.length(), needle)
== 0;
haystack.rfind(needle) == (haystack.size() - needle.size());
```
>From 7f0
nicovank wrote:
Oops, for this reason my software duplicated #105366 when I meant to just
rebase and ping.
Sorry. Closing the old one.
https://github.com/llvm/llvm-project/pull/110448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lis
@@ -25,6 +25,13 @@ AST_MATCHER_P(DeducedTemplateSpecializationType,
refsToTemplatedDecl,
return false;
}
+AST_MATCHER_P(Type, getTagDecl,
clang::ast_matchers::internal::Matcher,
nicovank wrote:
`asTagDecl` maybe?
https://github.com/llvm/llvm-project/pull
https://github.com/nicovank approved this pull request.
https://github.com/llvm/llvm-project/pull/110200
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank approved this pull request.
LGTM, nits. Maybe give a bit of time for others to take a look.
https://github.com/llvm/llvm-project/pull/78
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
@@ -0,0 +1,12 @@
+// RUN: %check_clang_tidy %s bugprone-sizeof-expression %t -- \
+// RUN: -config="{CheckOptions: [{key:
bugprone-sizeof-expression.WarnOnSizeOfPointerArithmeticWithDivisionScaled,
value: 0}]}"
nicovank wrote:
```suggestion
// RUN: %check_cla
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/78
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -306,8 +310,13 @@ void SizeofExpressionCheck::registerMatchers(MatchFinder
*Finder) {
unaryExprOrTypeTraitExpr(ofKind(UETT_AlignOf)),
offsetOfExpr()))
.bind("sizeof-in-ptr-arithmetic-scale-expr");
+ const auto PtrArithmeticIntege
@@ -31,6 +31,7 @@ class SizeofExpressionCheck : public ClangTidyCheck {
const bool WarnOnSizeOfCompareToConstant;
const bool WarnOnSizeOfPointerToAggregate;
const bool WarnOnSizeOfPointer;
+ const bool WarnOnSizeOfPointerArithmeticWithDivisionScaled;
nic
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/111472
>From 4936acf06c30c1e9a3a300ec712845a4c56d5cd0 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Mon, 7 Oct 2024 23:08:44 -0400
Subject: [PATCH] [clang-tidy][performance-move-const-arg] Fix crash when
ar
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/111472
>From 4936acf06c30c1e9a3a300ec712845a4c56d5cd0 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Mon, 7 Oct 2024 23:08:44 -0400
Subject: [PATCH] [clang-tidy][performance-move-const-arg] Fix crash when
ar
https://github.com/nicovank created
https://github.com/llvm/llvm-project/pull/111472
Fix #111450.
When the argument type is forward-declared and there is no definition,
`hasMoveConstructor` triggers the assert here:
https://github.com/llvm-project/llvm-project/blob/7f65377880ce6a0e5eaa4cb2591
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/111472
>From a321d32fd8f2d2ee2c760f7530dd5d9c6e7d4f00 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Mon, 7 Oct 2024 23:16:19 -0400
Subject: [PATCH] [clang-tidy][performance-move-const-arg] Fix crash when
ar
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/111472
>From a321d32fd8f2d2ee2c760f7530dd5d9c6e7d4f00 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Mon, 7 Oct 2024 23:16:19 -0400
Subject: [PATCH] [clang-tidy][performance-move-const-arg] Fix crash when
ar
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/104540
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank approved this pull request.
LGTM! Minus alphabetical ordering in release notes. I'll merge this tomorrow to
give time to others just in case.
FWIW this issue actually triggers a crash/assertion failure when those are
enabled:
```
clang-tidy: clang-tools-extra/clang-
@@ -141,6 +141,10 @@ New check aliases
Changes in existing checks
^^
+- Fixed :doc:`cppcoreguidelines-pro-type-union-access
+ ` check to
+ report a location even when the member location is not valid.
nicovank wrote:
Order alphabetic
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/104540
>From 31ed1cf97be643b3a6c9a05d4e461789c37e2408 Mon Sep 17 00:00:00 2001
From: Konstantin Romanov
Date: Fri, 9 Aug 2024 23:40:07 -0400
Subject: [PATCH 1/7] Workaround for cppcoreguidelines-pro-type-union-access
nicovank wrote:
There's a CI failure but looks unrelated. If you have a minute please
rebase/merge main to trigger the checks again and hopefully the problem
disappears. We can also just keep an eye on the buildbots post-merge tomorrow.
https://github.com/llvm/llvm-project/pull/104540
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/110386
>From e1dc2f848ee74fbd2775c4943c6bf03990f7c164 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Sun, 29 Sep 2024 14:05:33 -0400
Subject: [PATCH] [clang-tidy][readability-container-contains] Fix matching
@@ -30,9 +32,15 @@ void ContainerContainsCheck::registerMatchers(MatchFinder
*Finder) {
ofClass(cxxRecordDecl(HasContainsMatchingParamType)
.bind("call");
+ const auto Literal0 = integerLiteral(equals(0));
+ const auto Literal1 = integerLiteral(e
@@ -50,12 +50,16 @@ struct basic_string {
size_type find(const _Type& str, size_type pos = 0) const;
size_type find(const C* s, size_type pos = 0) const;
size_type find(const C* s, size_type pos, size_type n) const;
+ size_type find(C ch, size_type pos = 0) const;
s
@@ -453,3 +458,29 @@ void testOperandPermutations(std::map& Map) {
// CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use 'contains' to check
for membership [readability-container-contains]
// CHECK-FIXES: if (!Map.contains(0)) {};
}
+
+void testStringNops(std::string St
@@ -32,7 +33,8 @@ void ContainerContainsCheck::registerMatchers(MatchFinder
*Finder) {
const auto FindCall =
cxxMemberCallExpr(
- argumentCountIs(1),
+ anyOf(argumentCountIs(1),
+allOf(argumentCountIs(2), hasArgument(1,
cxxDefaultArg
@@ -50,12 +50,16 @@ struct basic_string {
size_type find(const _Type& str, size_type pos = 0) const;
size_type find(const C* s, size_type pos = 0) const;
size_type find(const C* s, size_type pos, size_type n) const;
+ size_type find(C ch, size_type pos = 0) const;
--
@@ -104,6 +108,9 @@ struct basic_string_view {
size_type rfind(const C* s, size_type pos, size_type count) const;
size_type rfind(const C* s, size_type pos = npos) const;
+ bool contains(const C *s) const;
+ bool contains(C s) const;
nicovank wrote:
```
@@ -29,6 +29,43 @@ struct multimap {
bool contains(const Key &K) const;
};
+using size_t = decltype(sizeof(int));
+
+// Lightweight standin for std::string_view.
+template
+class basic_string_view {
+public:
+ basic_string_view();
+ basic_string_view(const basic_string_vi
nicovank wrote:
Thanks!
Is there still an issue with type stuff? If so, what would be a test case that
fails that shouldn't?
https://github.com/llvm/llvm-project/pull/110351
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/104540
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/113688
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nicovank wrote:
@z1nke I will go ahead and click the merge button. Thanks!
https://github.com/llvm/llvm-project/pull/113688
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/113688
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank approved this pull request.
Looking at it again, this way is also good, no preference. Good to merge 👍
https://github.com/llvm/llvm-project/pull/113688
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.l
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/110386
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nicovank wrote:
FYI I'm going to merge #110386 now which will cause conflicts (`binaryOperator`
-> `binaryOperation`).
https://github.com/llvm/llvm-project/pull/110351
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
nicovank wrote:
FWIW I think it's a good idea in modernize-use-starts-ends-with documentation
to use a table as in
[readability-container-contains](https://clang.llvm.org/extra/clang-tidy/checks/readability/container-contains.html).
Here is a table with the c
@@ -0,0 +1,82 @@
+//===--- UndefinedSprintfOverlapCheck.cpp - clang-tidy
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,36 @@
+//===--- UndefinedSprintfOverlapCheck.h - clang-tidy *- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,82 @@
+//===--- UndefinedSprintfOverlapCheck.cpp - clang-tidy
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,59 @@
+// RUN: %check_clang_tidy %s bugprone-undefined-sprintf-overlap %t
+
+using size_t = decltype(sizeof(int));
+
+extern "C" int sprintf(char *s, const char *format, ...);
+extern "C" int snprintf(char *s, size_t n, const char *format, ...);
+
+namespace std {
+ in
@@ -0,0 +1,82 @@
+//===--- UndefinedSprintfOverlapCheck.cpp - clang-tidy
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,82 @@
+//===--- UndefinedSprintfOverlapCheck.cpp - clang-tidy
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/nicovank commented:
I have questions regarding the motivation behind adding this check:
1. How common is this bug?
2. What happens in practice at runtime?
3. What are existing ways of detecting this, if any?
https://github.com/llvm/llvm-project/pull/114244
_
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/114244
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,23 @@
+.. title:: clang-tidy - bugprone-undefined-sprintf-overlap
+
+bugprone-undefined-sprintf-overlap
+==
+
+Warns if any arguments to the ``sprintf`` family of functions overlap with the
+first argument.
+
+.. code-block:: c++
+
+c
@@ -0,0 +1,23 @@
+.. title:: clang-tidy - bugprone-undefined-sprintf-overlap
+
+bugprone-undefined-sprintf-overlap
nicovank wrote:
Just to throw another option out there, `bugprone-sprintf-argument-overlap`.
Others might have opinions.
https://github.com/llvm/l
@@ -153,6 +153,7 @@ Clang-Tidy Checks
:doc:`bugprone-too-small-loop-variable `,
:doc:`bugprone-unchecked-optional-access
`,
:doc:`bugprone-undefined-memory-manipulation
`,
+ :doc:`bugprone-undefined-sprintf-overlap
`, "Yes"
nicovank wrote:
```sug
nicovank wrote:
Oops, crossed signals with @5chmidti. Hopefully not too much overlap sorry.
https://github.com/llvm/llvm-project/pull/114244
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
@@ -0,0 +1,36 @@
+//===--- UndefinedSprintfOverlapCheck.h - clang-tidy *- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/114244
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/107521
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank created
https://github.com/llvm/llvm-project/pull/109178
Simplifies two cases and matches two new cases previously missing,
`container.end() [!=]= container.find(...)`.
I had split this change from #107521 for easier review.
>From a8b8ce089e9eeadf1b8b424e426f7372
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/101450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+#ifndef
LLVM_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_CHECKERS_INPUTS_BDE_TYPES_NULLABLEVALUE_H_
+#define
LLVM_CLANG_TOOLS_EXTRA_TEST_CLANG_TIDY_CHECKERS_INPUTS_BDE_TYPES_NULLABLEVALUE_H_
+
+#include "bsl_optional.h"
+
+/// Mock of `bdbl::NullableValue`.
-
https://github.com/nicovank approved this pull request.
LGTM. Rebase to fix release notes conflict and I'll merge 👍
https://github.com/llvm/llvm-project/pull/101450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
https://github.com/nicovank commented:
IMO no need to update release notes:
> Improved `readability-container-contains` check to let it work on any class
> that has a contains method.
But I think an example should be added to [the check
documentation](https://github.com/llvm/llvm-project/blob
@@ -51,6 +53,12 @@ void ContainerContainsCheck::registerMatchers(MatchFinder
*Finder) {
const auto Literal0 = integerLiteral(equals(0));
const auto Literal1 = integerLiteral(equals(1));
+ const auto StringLikeClass = cxxRecordDecl(
+ hasAnyName("::std::basic_string"
@@ -29,6 +29,43 @@ struct multimap {
bool contains(const Key &K) const;
};
+using size_t = decltype(sizeof(int));
+
+// Lightweight standin for std::string_view.
+template
+class basic_string_view {
+public:
+ basic_string_view();
+ basic_string_view(const basic_string_vi
@@ -453,3 +490,15 @@ void testOperandPermutations(std::map& Map) {
// CHECK-MESSAGES: :[[@LINE-1]]:{{[0-9]+}}: warning: use 'contains' to check
for membership [readability-container-contains]
// CHECK-FIXES: if (!Map.contains(0)) {};
}
+
+void testStringNops(std::string St
@@ -94,12 +102,14 @@ void ContainerContainsCheck::registerMatchers(MatchFinder
*Finder) {
binaryOperator(hasLHS(Literal1), hasOperatorName(">"), hasRHS(CountCall))
.bind("negativeComparison"));
- // Find membership tests based on `find() == end()`.
+ // Find
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/110351
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -32,7 +33,8 @@ void ContainerContainsCheck::registerMatchers(MatchFinder
*Finder) {
const auto FindCall =
cxxMemberCallExpr(
- argumentCountIs(1),
+ anyOf(argumentCountIs(1),
+allOf(argumentCountIs(2), hasArgument(1,
cxxDefaultArg
https://github.com/nicovank created
https://github.com/llvm/llvm-project/pull/110386
Fix #79437.
It works with non-mock `std::map`:
```
# All cases detailed in #79437.
> cat tmp.cpp
#include
bool a(std::map &m, int key) { return m.find(key) != m.end(); }
bool b(std::map &m, int key) { return
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/110386
>From e08eed95020b705f040ba55b70cf8d660b817618 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Sun, 29 Sep 2024 14:05:33 -0400
Subject: [PATCH] [clang-tidy][readability-container-contains] Fix matching
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/110386
>From e08eed95020b705f040ba55b70cf8d660b817618 Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Sun, 29 Sep 2024 14:05:33 -0400
Subject: [PATCH] [clang-tidy][readability-container-contains] Fix matching
nicovank wrote:
This test is passing for me even when I revert `ExprMutationAnalyzer.h`
changes. Is it standard library or setup specific?
https://github.com/llvm/llvm-project/pull/109145
___
cfe-commits mailing list
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/109145
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nicovank wrote:
Ha, TIL that `LLVM_ENABLE_ASSERTIONS` is only in `Debug` mode, not
`RelWithDebInfo` which I use in my local build. I assume CI uses `Debug` so
this is fine, just wanted to be sure something always breaks if ever this was
changed again. Thanks!
https://github.com/nicovank approved this pull request.
https://github.com/llvm/llvm-project/pull/109145
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/109178
>From 3f5df5d8299a48fe0bf919cd2d52eaa195b1e8ce Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Thu, 19 Sep 2024 12:35:47 -0400
Subject: [PATCH] [clang-tidy][readability-container-contains] Use hasOperan
https://github.com/nicovank updated
https://github.com/llvm/llvm-project/pull/109178
>From 3f5df5d8299a48fe0bf919cd2d52eaa195b1e8ce Mon Sep 17 00:00:00 2001
From: Nicolas van Kempen
Date: Thu, 19 Sep 2024 12:35:47 -0400
Subject: [PATCH] [clang-tidy][readability-container-contains] Use hasOperan
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/109178
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/101450
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nicovank wrote:
I fixed a similar issue in 0aaac4fe194ae2249e1a01f9d6f5eac0d75c5bb2. There's an
argument to be made whether this should be in the matchers (`isPOD`,
`isAggregate` like here) versus an `hasDefinition` call in the parent before
calling those matchers. I am slightly leaning toward
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/112162
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank closed
https://github.com/llvm/llvm-project/pull/117837
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/nicovank commented:
Looks good minus nits and IMO ignore any macro issues as commented.
https://github.com/llvm/llvm-project/pull/116033
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -71,6 +71,17 @@ struct NotLengthExprForStringNode {
ASTContext *Context;
};
+static bool isNegativeComparison(const Expr *ComparisonExpr) {
nicovank wrote:
Nit: place above `NotLengthExprForStringNode` so `lengthExprForStringNode` and
`NotLengthExprForS
@@ -183,40 +209,44 @@ void UseStartsEndsWithCheck::check(const
MatchFinder::MatchResult &Result) {
const auto *EndsWithFunction =
Result.Nodes.getNodeAs("ends_with_fun");
assert(bool(StartsWithFunction) != bool(EndsWithFunction));
+
const CXXMethodDecl *Replacemen
https://github.com/nicovank approved this pull request.
https://github.com/llvm/llvm-project/pull/116635
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -449,7 +449,8 @@ void
ExceptionAnalyzer::ExceptionInfo::reevaluateBehaviour() {
ExceptionAnalyzer::ExceptionInfo ExceptionAnalyzer::throwsException(
const FunctionDecl *Func, const ExceptionInfo::Throwables &Caught,
llvm::SmallSet &CallStack) {
- if (!Func || CallS
https://github.com/nicovank edited
https://github.com/llvm/llvm-project/pull/116033
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -183,40 +209,44 @@ void UseStartsEndsWithCheck::check(const
MatchFinder::MatchResult &Result) {
const auto *EndsWithFunction =
Result.Nodes.getNodeAs("ends_with_fun");
assert(bool(StartsWithFunction) != bool(EndsWithFunction));
+
const CXXMethodDecl *Replacemen
201 - 300 of 446 matches
Mail list logo