https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/147066
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -134,14 +136,27 @@ void QualifiedAutoCheck::registerMatchers(MatchFinder
*Finder) {
auto IsBoundToType = refersToType(equalsBoundNode("type"));
auto UnlessFunctionType =
unless(hasUnqualifiedDesugaredType(functionType()));
- auto IsAutoDeducedToPointer = [](const std
@@ -96,3 +96,23 @@ Note in the LLVM alias, the default value is `false`.
matched against only the type name (i.e. ``Type``). E.g. to suppress reports
for ``std::array`` iterators use `std::array<.*>::(const_)?iterator` string.
The default is an empty string.
+
+.. option:
@@ -121,3 +121,100 @@ int AllComparisons() {
return 0;
}
+
+namespace PR127471 {
+int getSignedValue();
+unsigned int getUnsignedValue();
+
+void callExprTest() {
+
+if (getSignedValue() < getUnsignedValue())
+return;
+// CHECK-MESSAGES: :[[
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=
Message-ID:
In-Reply-To:
@@ -140,6 +140,12 @@ Changes in existing checks
calls of ``std::string`` constructor with char pointer
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID:
In-Reply-To:
@@ -147,3 +148,16 @@ struct Name {\
// CHECK-MESSAGES: :[[@LINE+1]]:44: warning: tagged union has more d
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?=,=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?Message-ID:
In-Reply-To:
@@ -9,6 +9,9 @@ different from the number of data members inside the union.
A struct or a class is conside
5chmidti wrote:
Please add more tests:
- one of the args being, e.g., `int`, since there should still be a warning
- also add those same tests to the C++ tests to cover that they are being
handled correctly in both languages
https://github.com/llvm/llvm-proje
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/139474
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/139474
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,254 @@
+//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap
@@ -0,0 +1,227 @@
+.. title:: clang-tidy - portability-avoid-platform-specific-fundamental-types
+
+portability-avoid-platform-specific-fundamental-types
+=
+
+Finds fundamental types (e.g. `int`, `float`) and recommends using ty
@@ -0,0 +1,254 @@
+//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap
@@ -0,0 +1,254 @@
+//===--- AvoidPlatformSpecificFundamentalTypesCheck.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: Ap
@@ -0,0 +1,227 @@
+.. title:: clang-tidy - portability-avoid-platform-specific-fundamental-types
+
+portability-avoid-platform-specific-fundamental-types
+=
+
+Finds fundamental types (e.g. `int`, `float`) and recommends using ty
@@ -503,6 +503,21 @@ getCheckNames(const ClangTidyOptions &Options,
return Factory.getCheckNames();
}
+void filterCheckOptions(ClangTidyOptions &Options,
+const std::vector &EnabledChecks) {
+ StringSet<> EnabledChecksSet(llvm::from_range, EnabledChe
https://github.com/5chmidti approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/147142
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/147142
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/147553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -141,6 +141,42 @@ void
nullable_value_after_swap(BloombergLP::bdlb::NullableValue &opt1, Bloo
}
}
+void assertion_handler_imp() __attribute__((analyzer_noreturn));
+
+void assertion_handler() {
+do {
+ assertion_handler_imp();
+} while(0);
+}
+
+void functi
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-8?q?Heidekr=C3=BCger?= ,
Paul =?utf-
=��___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
https://github.com/5chmidti approved this pull request.
LGTM minus the open conversation
https://github.com/llvm/llvm-project/pull/146830
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit
5chmidti wrote:
The option name could also be something like `IgnoreAliasing` or something
similar. You're also missing changes to the check docs itself.
https://github.com/llvm/llvm-project/pull/147060
___
cfe-commits mailing list
cfe-commits@lists.l
5chmidti wrote:
> > Have you looked at google-runtime-int? It should be doing the same thing
> > (maybe small differences)
>
> I haven't before now. I still think a new check is necessary.
>
> `google-runtime-int` isn't as strict because it is coupled to the Google
> coding guidelines. That
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heidekrüger?= ,
Paul =?utf-8?q?Heide
@@ -0,0 +1,107 @@
+//===--- UseConcisePreprocessorDirectivesCheck.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: Ap
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/147012
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/147048
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
5chmidti wrote:
> > That's probably happening due to incomplete C++20 support in either Clang
> > 14 or the GNU libstdc++ 12.
>
> Current standard that LLVM use is c++17. But we generally should support
> compilers at [least 3 years of
> compilers](https://llvm.org/docs/DeveloperPolicy.html#u
https://github.com/5chmidti commented:
Have you looked at google-runtime-int? It should be doing the same thing (maybe
small differences)
https://github.com/llvm/llvm-project/pull/146970
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://
5chmidti wrote:
> Another interesting case, it seems somehow multiple constexprs got added, ex:
>
> ```c++
> template
> constexpr constexpr constexpr constexpr constexpr constexpr constexpr
> constexpr int numberOfSidesOfDimension(int dimension);
> ```
>
> This actually compiles, though with
5chmidti wrote:
> Another compiler error after transformation:
>
> It made this constexpr:
>
> ```c++
> PUGI_IMPL_FN constexpr bool is_nan(double value)
> {
> #if defined(PUGI_IMPL_MSVC_CRT_VERSION) || defined(__BORLANDC__)
> return !!_isnan(value);
> #elif
@@ -0,0 +1,562 @@
+// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t
-- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr
%t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy
5chmidti wrote:
Sorry for the silly docs mistakes, btw.
I've updated the docs, added replacement string options, and fixed the `const`
keyword removal.
https://github.com/llvm/llvm-project/pull/146553
___
cfe-commits mailing list
cfe-commits@lists.l
5chmidti wrote:
Thanks for testing this on your codebase so fast as well.
> I got some fixits that do not compile, e.g.:
>
> ```
> std::erase_if(numbers, [](int n) {
> return n % 2 == 0;
> });
> ```
>
> is changed into
>
> ```
> std::erase_if(numbers, [](int nconstexpr ) {
> return n % 2 == 0
5chmidti wrote:
> I tried with [ITK](https://github.com/InsightSoftwareConsortium/ITK/) and the
> resulting transformation did not compile.
>
> Many changes were of this form:
>
> ```diff
> -const double Max = 1.0 - Min;
> +constexpr double Max = 1.0 - Min;
> ```
>
> Which is
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/146553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,562 @@
+// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t
-- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr
%t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy
@@ -0,0 +1,562 @@
+// RUN: %check_clang_tidy -std=c++11 -check-suffix=11 %s misc-use-constexpr %t
-- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy -std=c++14 -check-suffix=11,14 %s misc-use-constexpr
%t -- -- -fno-delayed-template-parsing
+// RUN: %check_clang_tidy
5chmidti wrote:
> > misc-use-constexpr? :)
>
> modernize-use-constexpr?
Hm. It is indeed also a modernization... +- on which to pick. Let's see what
others think.
On one hand, the modernize checks have
- modernize-use-auto
- modernize-use-nodiscard
- modernize-use-noexcept
- modernize-use-over
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/146553
>From 16d5a3fb942673d1fda0ef4b17363a0b5d634fbb Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Fri, 6 Sep 2024 22:58:46 +0200
Subject: [PATCH] [clang-tidy] add misc-constexpr check
This check finds all fun
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/146553
>From 8d354249e8c28fb2a83f90479cc74e41be2d58be Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Fri, 6 Sep 2024 22:58:46 +0200
Subject: [PATCH] [clang-tidy] add misc-constexpr check
This check finds all fun
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/146553
>From 2a50c3ef9aed91488a5650b8f3719fc338db7a49 Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Fri, 6 Sep 2024 22:58:46 +0200
Subject: [PATCH] [clang-tidy] add misc-constexpr check
This check finds all fun
5chmidti wrote:
I ran this check on all of `clang/` and `clang-tools-extra/` and got no
compilation errors from too aggressively changing things to `constexpr`.
Some perf info from running the checks enabled in LLVM + this check:
Running on: `clang/lib/Sema/SemaExprCXX.cpp` (1 diag):
```text
=
https://github.com/5chmidti created
https://github.com/llvm/llvm-project/pull/146553
This check finds all functions and variables that can be declared as
`constexpr`, using the specified standard version to check if the
requirements are met.
Fixes #115622
>From 35a081fba2d15ee9f4ae825928e5411
5chmidti wrote:
> > Actually, the cxxRecordDecl might not be in a macro, but the special member
> > functions are.
>
> The checker doc states:
> `The check finds classes where some but not all of the special member
> functions are defined.`
> I think we only need to ignore if the whole class e
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/143554
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
LGTM minus comments
https://github.com/llvm/llvm-project/pull/143554
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -45,11 +53,12 @@ SpecialMemberFunctionsCheck::getCheckTraversalKind() const {
}
void SpecialMemberFunctionsCheck::registerMatchers(MatchFinder *Finder) {
- auto IsNotImplicitOrDeleted = anyOf(unless(isImplicit()), isDeleted());
+ const auto IsNotImplicitOrDeleted = anyOf(
https://github.com/5chmidti deleted
https://github.com/llvm/llvm-project/pull/143550
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -50,3 +50,12 @@ Modern C++ needs ``goto`` only to jump out of nested loops.
some_operation();
All other uses of ``goto`` are diagnosed in `C++`.
+
+
+Options
+---
+
+.. option:: IgnoreMacros
+
+ If set to `true`, the check will not warn if ``goto`` statement is plac
5chmidti wrote:
Actually, the cxxRecordDecl might not be in a macro, but the special member
functions are.
E.g.:
``` ` ` cpp
#define DEF_COPY(name) \
name(const name&) = default; \
name& operator=(const name&) = default;
` ` `
https://github.com/llvm/llvm-project/pull/143550
__
@@ -1,27 +1,34 @@
// RUN: %check_clang_tidy %s cppcoreguidelines-avoid-goto %t
+// RUN: %check_clang_tidy -check-suffix=MACRO %s cppcoreguidelines-avoid-goto
%t -- -config="{CheckOptions: { cppcoreguidelines-avoid-goto.IgnoreMacros: true
}}"
5chmidti wrote:
Yo
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/143550
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
LGTM but I'm +- on the default
Let's see if others have a stronger opinion on the default
---
Not directly part of this, but:
I'd prefer to see a warning for expansions of macros defined inside the code
base, but not from macros defined
https://github.com/5chmidti approved this pull request.
Alright, that makes sense to me. LGTM minus open comments
https://github.com/llvm/llvm-project/pull/142839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/ma
@@ -0,0 +1,32 @@
+.. title:: clang-tidy - performance-explicit-move-constructor
+
+performance-explicit-move-constructor
+=
+
+Warns when a class defines an explicit move constructor, which may cause
+the copy constructor to get called instead.
5chmidti wrote:
> > but this check could check the signatures themselves to be in the expected
> > form
>
> So warning for signatures like `foo(foo&) = default`?
Looking at this again, maybe this shouldn't not that route. Other checks
already capture some of those problems.
What @PiotrZSL me
@@ -0,0 +1,76 @@
+//===--- ExplicitMoveConstructorCheck.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,76 @@
+//===--- ExplicitMoveConstructorCheck.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,76 @@
+//===--- ExplicitMoveConstructorCheck.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/5chmidti commented:
Generalizing this check to enforce either static or anonymous namespaces would
be great, then it would not be specific to LLVM and projects using a similar
style. So something like misc-static-or-anonymous-namespace.
WDYT?
https://github.com/llvm/llvm-pro
5chmidti wrote:
It would be better to combine these files with a check suffix and two RUN lines
so that you can check tru-negatives for the options as well. Depending on the
options the matches should be a strict superset for cars or member functions,
e.g. a
@@ -0,0 +1,73 @@
+.. title:: clang-tidy - llvm-prefer-static-over-anonymous-namespace
+
+llvm-prefer-static-over-anonymous-namespace
+===
+
+Finds function and variable declarations inside anonymous namespace and
+suggests replacing them wit
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/142839
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/130369
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -181,42 +160,105 @@ void ConfusableIdentifierCheck::check(
if (!ND)
return;
- IdentifierInfo *NDII = ND->getIdentifier();
+ addDeclToCheck(ND, cast(ND->getDeclContext()
+->getNonTransparentContext()));
+
+ // Associate template p
@@ -181,42 +160,105 @@ void ConfusableIdentifierCheck::check(
if (!ND)
return;
- IdentifierInfo *NDII = ND->getIdentifier();
+ addDeclToCheck(ND, cast(ND->getDeclContext()
+->getNonTransparentContext()));
+
+ // Associate template p
https://github.com/5chmidti approved this pull request.
LGTM. Thanks for the quite big performance improvement, and sorry this took a
bit until it was reviewed.
https://github.com/llvm/llvm-project/pull/130369
___
cfe-commits mailing list
cfe-commits@
@@ -654,6 +716,83 @@
ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(const Expr *Exp) {
return nullptr;
}
+const Stmt *
+ExprMutationAnalyzer::Analyzer::findPointeeValueMutation(const Expr *Exp) {
+ const auto Matches = match(
+ stmt(forEachDescendant(
+
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/118593
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
Looks good in general, could you add a small description to the pr?
https://github.com/llvm/llvm-project/pull/118593
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -1609,4 +1610,349 @@ TEST(ExprMutationAnalyzerTest, ReproduceFailureMinimal)
{
match(withEnclosingCompound(declRefTo("x")), AST11->getASTContext());
EXPECT_FALSE(isMutated(Results11, AST11.get()));
}
+
+static bool isPointeeMutated(const SmallVectorImpl &Results,
+
@@ -112,6 +115,57 @@ AST_MATCHER_P(Stmt, canResolveToExpr, const Stmt *, Inner)
{
return canExprResolveTo(Exp, Target);
}
+// use class member to store data can reduce stack usage to avoid stack
overflow
+// when recursive call.
+class ExprPointeeResolve {
+ const Expr *T
@@ -112,6 +115,57 @@ AST_MATCHER_P(Stmt, canResolveToExpr, const Stmt *, Inner)
{
return canExprResolveTo(Exp, Target);
}
+// use class member to store data can reduce stack usage to avoid stack
overflow
+// when recursive call.
+class ExprPointeeResolve {
+ const Expr *T
@@ -654,6 +716,83 @@
ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(const Expr *Exp) {
return nullptr;
}
+const Stmt *
+ExprMutationAnalyzer::Analyzer::findPointeeValueMutation(const Expr *Exp) {
+ const auto Matches = match(
+ stmt(forEachDescendant(
+
@@ -654,6 +716,83 @@
ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(const Expr *Exp) {
return nullptr;
}
+const Stmt *
+ExprMutationAnalyzer::Analyzer::findPointeeValueMutation(const Expr *Exp) {
+ const auto Matches = match(
+ stmt(forEachDescendant(
+
@@ -654,6 +716,83 @@
ExprMutationAnalyzer::Analyzer::findFunctionArgMutation(const Expr *Exp) {
return nullptr;
}
+const Stmt *
+ExprMutationAnalyzer::Analyzer::findPointeeValueMutation(const Expr *Exp) {
+ const auto Matches = match(
+ stmt(forEachDescendant(
+
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/118593
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/120055
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,217 @@
+//===--- StringViewSubstrCheck.cpp - 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: Ap
https://github.com/5chmidti commented:
You can move even more into the matchers. Here is a mock-up of what I mean
(untested):
```
m cxxMemberCallExpr(
anyOf(
cxxMemberCallExpr(
argumentCountIs(1)
# is substr, and bind arg 1
),
cxxMemberCallExpr(
argumentCoun
@@ -0,0 +1,217 @@
+//===--- StringViewSubstrCheck.cpp - 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: Ap
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/122141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -337,33 +337,34 @@ FileOptionsBaseProvider::FileOptionsBaseProvider(
void FileOptionsBaseProvider::addRawFileOptions(
llvm::StringRef AbsolutePath, std::vector &CurOptions) {
auto CurSize = CurOptions.size();
-
// Look for a suitable configuration file in all parent
https://github.com/5chmidti approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/121406
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/121406
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/117165
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -139,6 +150,12 @@ Options
function, and an optional reason, separated by comma. For more information,
see :ref:`Custom functions`.
+.. option:: ShowFullyQualifiedNames
+
+When `true`, the fully qualified name of all functions matched by the
custom
+function
https://github.com/5chmidti approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/121783
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -40,11 +40,30 @@ void
UncheckedOptionalAccessCheck::registerMatchers(MatchFinder *Finder) {
this);
}
+void UncheckedOptionalAccessCheck::onStartOfTranslationUnit() {
+ // Reset the flag for each TU.
+ is_test_tu_ = false;
+}
+
void UncheckedOptionalAccessCheck::ch
@@ -40,11 +40,30 @@ void
UncheckedOptionalAccessCheck::registerMatchers(MatchFinder *Finder) {
this);
}
+void UncheckedOptionalAccessCheck::onStartOfTranslationUnit() {
+ // Reset the flag for each TU.
+ is_test_tu_ = false;
+}
+
void UncheckedOptionalAccessCheck::ch
https://github.com/5chmidti commented:
Sorry for the delay.
I think, that we can probably all agree that the best solution would be to have
the model support the macros, e.g., by recognizing the patterns that are behind
these macros. However, that is currently not something that people can fin
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/115051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/121316
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,134 @@
+//===--- SmartptrResetAmbiguousCallCheck.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: Ap
1 - 100 of 1290 matches
Mail list logo