@@ -0,0 +1,93 @@
+// RUN: %check_clang_tidy -std=c++14-or-later %s
performance-unnecessary-value-param %t
+
+struct ExpensiveToCopyType {
+ virtual ~ExpensiveToCopyType();
+};
+
+template void templateWithNonTemplatizedParameter(const
ExpensiveToCopyType S, T V) {
+ //
@@ -0,0 +1,93 @@
+// RUN: %check_clang_tidy -std=c++14-or-later %s
performance-unnecessary-value-param %t
+
+struct ExpensiveToCopyType {
+ virtual ~ExpensiveToCopyType();
+};
+
+template void templateWithNonTemplatizedParameter(const
ExpensiveToCopyType S, T V) {
+ //
@@ -0,0 +1,181 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,248 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,68 @@
+//===--- UseRangesCheck.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:
@@ -26,6 +26,7 @@ add_clang_library(clangTidyUtils
TransformerClangTidyCheck.cpp
TypeTraits.cpp
UsingInserter.cpp
+ UseRangesCheck.cpp
5chmidti wrote:
Please fix the ordering for these two files
https://github.com/llvm/llvm-project/pull/97764
@@ -0,0 +1,248 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,248 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,248 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,248 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,248 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,181 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,248 @@
+//===--- UseRangesCheck.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:
@@ -0,0 +1,181 @@
+//===--- UseRangesCheck.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:
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/97764
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
This will be great to have.
It should be possible to add support for template function decls in a
follow-up. Maybe this should be documented to avoid confusion?
https://github.com/llvm/llvm-project/pull/97764
@@ -25,3 +25,16 @@ Example:
}
// already declared as extern
extern int v2;
+
+Options
+---
+
+.. option:: FixMode
+
+ Selects the fix mode when fixing automatically.
5chmidti wrote:
Not sure if it is better: `Selects what kind of a fix the check
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/96203
___
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 from my side
https://github.com/llvm/llvm-project/pull/96203
___
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/96199
___
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
https://github.com/llvm/llvm-project/pull/96122
___
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/86448
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
5chmidti wrote:
No worries. Feel free to ask in reviews or in discord though. Feel free to
close it if you don't want to work on this anymore. The pr will still be linked
in the issue, in case someone wants to look at it.
https://github.com/llvm/llvm-project/pull/71304
@@ -0,0 +1,81 @@
+//===--- PointerArithmeticOnPolymorphicObjectCheck.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:
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
=��___
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
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
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
=��___
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
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
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
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
https://github.com/5chmidti commented:
When you add a `.` to make the help messages sentences, then you might want to
capitalize the first word as well.
https://github.com/llvm/llvm-project/pull/96199
___
cfe-commits mailing list
@@ -82,11 +82,19 @@ static constexpr StringRef Message =
void UseInternalLinkageCheck::check(const MatchFinder::MatchResult ) {
if (const auto *FD = Result.Nodes.getNodeAs("fn")) {
-diag(FD->getLocation(), Message) << "function" << FD;
+DiagnosticBuilder DB =
5chmidti wrote:
The other two functions have fixes as well. I'd argue that template
declarations don't need to be inside anonymous namespaces/`static`, but that's
outside the scope of this pr.
Either way, this pr should check that both have an attached
5chmidti wrote:
the same should probably be done for `diff-clang-tidy.py`
https://github.com/llvm/llvm-project/pull/96122
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -0,0 +1,5 @@
+// RUN: not clang-tidy %s -checks='-*'
+// RUN: clang-tidy %s -checks='-*' --allow-no-checks | FileCheck
--match-full-lines %s
+
+
+// CHECK: No checks enabled.
5chmidti wrote:
missing newline
https://github.com/llvm/llvm-project/pull/96122
@@ -651,7 +659,7 @@ int clangTidyMain(int argc, const char **argv) {
return 0;
}
- if (EnabledChecks.empty()) {
+ if (EnabledChecks.empty() && !AllowNoChecks) {
llvm::errs() << "Error: no checks enabled.\n";
llvm::cl::PrintHelpMessage(/*Hidden=*/false,
https://github.com/5chmidti commented:
´run-clang-tidy.py` and `clang-tidy-diff.py` should probably expose an option
to enable this option via the script (maybe with an adjustment to the release
notes).
https://github.com/llvm/llvm-project/pull/96122
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/96122
___
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/89490
___
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
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/95667
___
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
https://github.com/llvm/llvm-project/pull/95667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -387,3 +387,38 @@ void foo(const StructWithFieldContainer ) {
B.push_back(Number);
}
}
+
+namespace gh95596 {
+
+void f(std::vector& t) {
+ {
+std::vector gh95596_0;
+// CHECK-FIXES: gh95596_0.reserve(10);
+for (unsigned i = 0; i < 10; ++i)
+
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/95667
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,67 @@
+//===--- ExceptionRethrowCheck.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:
@@ -111,16 +115,18 @@ void ContainerDataPointerCheck::check(const
MatchFinder::MatchResult ) {
MemberExpr>(CE))
ReplacementText = "(" + ReplacementText + ")";
- if (CE->getType()->isPointerType())
-ReplacementText += "->data()";
- else
-
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/71304
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
@neoncube2 do you plan to continue working on this?
---
Because we are emitting a fix-it, it might be a good idea to check if the
return type of `c_str` is that of `data` (~possibly unwrapping aliases).
https://github.com/llvm/llvm-project/pull/71304
@@ -40,8 +40,10 @@ void ContainerDataPointerCheck::registerMatchers(MatchFinder
*Finder) {
cxxRecordDecl(
unless(matchers::matchesAnyListedName(IgnoredContainers)),
isSameOrDerivedFrom(
- namedDecl(
-
@@ -0,0 +1,67 @@
+//===--- ExceptionRethrowCheck.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:
@@ -0,0 +1,84 @@
+.. title:: clang-tidy - bugprone-exception-rethrow
+
+bugprone-exception-rethrow
+==
+
+Identifies problematic exception rethrowing, especially with caught exception
+variables or empty throw statements outside catch blocks.
+
+In C++
@@ -0,0 +1,67 @@
+//===--- ExceptionRethrowCheck.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:
@@ -0,0 +1,83 @@
+.. title:: clang-tidy - bugprone-exception-rethrow
+
+bugprone-exception-rethrow
+==
+
+Identifies problematic exception rethrowing, especially with caught exception
+variables or empty throw statements outside catch blocks.
+
+In C++
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/89490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -501,70 +506,72 @@ def main():
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile("|".join(args.files))
+files = {f for f in files if file_name_re.search(f)}
-return_code = 0
+returncode = 0
try:
-#
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/89490
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
The execution time of clang-tidy is a nice improvement as well.
---
> What OS/Python version does this occur on?
|OS|Python|Noisy Shutdown|
|-|-|-|
|Manjaro|3.11.9|Yes|
|NixOS|3.9.19|No|
|NixOS|3.10.14|No|
|NixOS|3.11.9|No|
|Manjaro|3.12.3|Yes|
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?=
Message-ID:
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?=
Message-ID:
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?=
Message-ID:
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?=
Message-ID:
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?=
Message-ID:
=��___
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?=
Message-ID:
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?=
Message-ID:
https://github.com/5chmidti approved this pull request.
While I'm leaning more towards
> NOLINT in the code can grab the attention of a future developer and prompt a
> refactoring to avoid the pattern.
, it's an off-by-default option that provides a choice.
LGTM
5chmidti wrote:
FYI: You could remove the explicit check-nots here:
```c++
// RUN: %check_clang_tidy %s -check-suffixes=,INTERNAL-LINKAGE
cppcoreguidelines-avoid-non-const-global-variables %t
// RUN: %check_clang_tidy %s
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/93827
___
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/94512
___
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/94654
___
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
https://github.com/llvm/llvm-project/pull/94651
___
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/94524
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -35,6 +37,11 @@ struct UseAfterMove {
// Is the order in which the move and the use are evaluated undefined?
bool EvaluationOrderUndefined;
5chmidti wrote:
While you're at it, please initialize `EvaluationOrderUndefined` to `false` as
well.
@@ -110,15 +117,32 @@ bool UseAfterMoveFinder::find(Stmt *CodeBlock, const Expr
*MovingCall,
BlockMap = std::make_unique(TheCFG.get(), Context);
Visited.clear();
- const CFGBlock *Block = BlockMap->blockContainingStmt(MovingCall);
- if (!Block) {
+ const CFGBlock
https://github.com/5chmidti approved this pull request.
LGTM after fixing these two comments, but let's wait for others to review as
well
https://github.com/llvm/llvm-project/pull/93623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/93623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -175,6 +218,10 @@ bool UseAfterMoveFinder::findInternal(const CFGBlock
*Block,
MovingCall != nullptr &&
Sequence->potentiallyAfter(MovingCall, Use);
+// We default to false here and change this to true if required in
+// find().
+
@@ -55,12 +55,23 @@ bool isDescendantOrEqual(const Stmt *Descendant, const Stmt
*Ancestor,
ASTContext *Context) {
if (Descendant == Ancestor)
return true;
- for (const Stmt *Parent : getParentStmts(Descendant, Context)) {
-if
@@ -95,9 +106,59 @@ bool ExprSequence::inSequence(const Stmt *Before, const
Stmt *After) const {
return true;
}
+ SmallVector BeforeParents = getParentStmts(Before, Context);
+
+ // Since C++17, the callee of a call expression is guaranteed to be sequenced
+ //
@@ -95,9 +106,59 @@ bool ExprSequence::inSequence(const Stmt *Before, const
Stmt *After) const {
return true;
}
+ SmallVector BeforeParents = getParentStmts(Before, Context);
+
+ // Since C++17, the callee of a call expression is guaranteed to be sequenced
+ //
@@ -69,6 +73,30 @@ class UseAfterMoveFinder {
llvm::SmallPtrSet Visited;
};
+/// Returns whether the `Before` block can reach the `After` block.
+bool reaches(const CFGBlock *Before, const CFGBlock *After) {
+ llvm::SmallVector Stack;
+ llvm::SmallPtrSet Visited;
+
+
@@ -0,0 +1,49 @@
+//===--- VirtualArithmeticCheck.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:
@@ -0,0 +1,78 @@
+//===--- PointerArithmeticOnPolymorphicObjectCheck.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:
https://github.com/5chmidti approved this pull request.
LGTM minus the stored option value. (please wait for others to finish their
review)
https://github.com/llvm/llvm-project/pull/91951
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/5chmidti edited
https://github.com/llvm/llvm-project/pull/91951
___
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/94243
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti updated
https://github.com/llvm/llvm-project/pull/94243
>From 1c6f2a0a2780d3189e1cfe2a0f4ac9c3a33fcf8d Mon Sep 17 00:00:00 2001
From: Julian Schmidt
Date: Sat, 1 Jun 2024 17:38:37 +0200
Subject: [PATCH] [clang][test] add TestLanguage.def to specify all tested
https://github.com/5chmidti created
https://github.com/llvm/llvm-project/pull/94243
Adds a def file to have a single location where tested language versions are
specified. Removes the need to update multiple locations in the testing
infrastructure to add a new language version to be tested.
@@ -1071,7 +1071,7 @@ bool IdentifierNamingCheck::isParamInMainLikeFunction(
if (!IsIntType(FDecl->parameters()[0]->getType()))
return false;
MainType Type = IsCharPtrPtr(FDecl->parameters()[1]->getType());
- if (Type == None)
+ if (Type is None)
@@ -0,0 +1,49 @@
+//===--- VirtualArithmeticCheck.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:
@@ -0,0 +1,49 @@
+//===--- VirtualArithmeticCheck.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:
https://github.com/5chmidti approved this pull request.
> I'm not 100% sure about release-notes entry. If it shouldn't say that check
> is restricted now to zero-argument size/length.
I'd use the release note as it is. Or what is your concern with it?
https://github.com/5chmidti approved this pull request.
https://github.com/llvm/llvm-project/pull/93467
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/5chmidti commented:
Thanks for the cleanup, it looks overall good (w.r.t `asyncio`: I only know
about `asyncio` what I read in this pr).
> Only print the filename after completion, not the entire Clang-Tidy
> invocation command. I find this neater but the behavior can
@@ -501,70 +506,72 @@ def main():
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile("|".join(args.files))
+files = {f for f in files if file_name_re.search(f)}
-return_code = 0
+returncode = 0
try:
-#
@@ -501,70 +506,72 @@ def main():
# Build up a big regexy filter from all command line arguments.
file_name_re = re.compile("|".join(args.files))
+files = {f for f in files if file_name_re.search(f)}
-return_code = 0
+returncode = 0
try:
-#
1 - 100 of 596 matches
Mail list logo