https://github.com/carlosgalvezp closed
https://github.com/llvm/llvm-project/pull/133694
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
carlosgalvezp wrote:
I believe I found something promising:
* Revert the parts of the code that sets the TraversalScope. This messes up the
`ParentMapContext`.
* Apply this change:
```
bool MatchASTVisitor::TraverseDecl(Decl *DeclNode) {
if (!DeclNode) {
return true;
}
+ if (Options.
https://github.com/carlosgalvezp created
https://github.com/llvm/llvm-project/pull/132016
Currently, the check is processing system macros. Most importantly, it tries to
find .clang-tidy files associated with those files, if the option
GetConfigPerFile (on by default) is active.
This is probl
@@ -0,0 +1,20 @@
+set(LLVM_LINK_COMPONENTS
+ support
+ )
+
+add_clang_library(clangTidyCustomModule STATIC
+ CustomTidyModule.cpp
+ QueryCheck.cpp
+
+ LINK_LIBS
+ clangTidy
+ clangTidyUtils
+
+ DEPENDS
+ ClangDriverOptions
+ )
+
+clang_target_link_libraries(clangTidyCust
carlosgalvezp wrote:
@kadircet Are you able to test this PR and confirm it fixes the regressions you
encountered?
https://github.com/llvm/llvm-project/pull/132725
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/m
carlosgalvezp wrote:
Ok! Will fix sometime today. I think this topic needs some more careful
iteration and we should unblock.
Worth noting is that even though a lot of warnings still remain the performance
gain was still significant, i.e. going from 10 seconds (baseline) to 3 seconds
(proposa
https://github.com/carlosgalvezp updated
https://github.com/llvm/llvm-project/pull/133582
>From 2ecbd54fbc82bbfad2e190529efd3a4cc71bd8df Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20G=C3=A1lvez?=
Date: Sat, 29 Mar 2025 11:55:02 +
Subject: [PATCH] [clang-tidy] Fix broken HeaderFilterReg
https://github.com/carlosgalvezp updated
https://github.com/llvm/llvm-project/pull/133582
>From 7f2b6448acee91deef7ff73fd36a92bb9787a674 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20G=C3=A1lvez?=
Date: Sat, 29 Mar 2025 11:55:02 +
Subject: [PATCH] [clang-tidy] Fix broken HeaderFilterReg
https://github.com/carlosgalvezp updated
https://github.com/llvm/llvm-project/pull/133582
>From 99abf89c1ed177be1b9a3f7f2acd85ffb726a757 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20G=C3=A1lvez?=
Date: Sat, 29 Mar 2025 11:55:02 +
Subject: [PATCH] [clang-tidy] Fix broken HeaderFilterReg
https://github.com/carlosgalvezp created
https://github.com/llvm/llvm-project/pull/133582
PR https://github.com/llvm/llvm-project/pull/91400 broke the usage of
HeaderFilterRegex via config file, because it is now created at a different
point in the execution and leads to a different value.
Th
https://github.com/carlosgalvezp updated
https://github.com/llvm/llvm-project/pull/133582
>From 12b63eb35ab09b6ae1aa0fbfa00487f4cad3cac7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20G=C3=A1lvez?=
Date: Sat, 29 Mar 2025 11:55:02 +
Subject: [PATCH] [clang-tidy] Fix broken HeaderFilterReg
https://github.com/carlosgalvezp requested changes to this pull request.
The changes to the clang-tidy check should be reverted IMO.
Also, please provide more information. What do you mean by "code sanitizer",
what is the exact error message, etc.
https://github.com/llvm/llvm-project/pull/1341
@@ -260,7 +260,7 @@ static IntegerRange createFromType(const ASTContext
&Context,
llvm::APSInt LowerValue(PrecisionBits + 2, /*isUnsigned*/ false);
LowerValue.setBit(PrecisionBits);
LowerValue.setSignBit();
-return {LowerValue, UpperValue};
+return {std::mo
carlosgalvezp wrote:
So I looked into the problem, and it seems that issue is that the
`ParentMapContext` class does not correctly find all the parents due to the
reduced AST traversal. One quick & dirty solution that makes the CERT test pass
(and keeps all the remaining tests passing) is as f
@@ -1007,3 +1007,11 @@ template void f() {
x[T{}] = 3;
}
} // namespace gh127776_false_positive
+
+namespace gh132931_false_positive {
+using T = const int;
+void valid(int i) {
+ const int arr0[] = {1, 2, 3};
+ T arr1[] = {1, 2, 3};
carlosgalvezp wrote:
@@ -1007,3 +1007,11 @@ template void f() {
x[T{}] = 3;
}
} // namespace gh127776_false_positive
+
+namespace gh132931_false_positive {
+using T = const int;
+void valid(int i) {
+ const int arr0[] = {1, 2, 3};
+ T arr1[] = {1, 2, 3};
carlosgalvezp wrote:
@@ -89,6 +89,8 @@ void ConstCorrectnessCheck::registerMatchers(MatchFinder
*Finder) {
const auto ConstReference = hasType(references(isConstQualified()));
carlosgalvezp wrote:
All the tests (including the FP at hand) pass if you remove
`unless(arrayType()` f
https://github.com/carlosgalvezp closed
https://github.com/llvm/llvm-project/pull/133582
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/carlosgalvezp approved this pull request.
Nice finding!
Nit: next time, please add `[clang-tidy]` to the beginning of the commit
message, so it's easier to see which part of the repo is affected.
https://github.com/llvm/llvm-project/pull/134385
__
carlosgalvezp wrote:
> It seems to be running on my .h files itself(?)
In that case, I don't believe clang-tidy considers the header "a header", but
actually "the main file" just like when analyzing a .cpp file. In that case,
`ExcludeHeaderFilterRegex` won't work.
https://github.com/llvm/llv
@@ -0,0 +1 @@
+HeaderFilterRegex: '.*'
carlosgalvezp wrote:
It appears this use case was broken by this
[patch](https://github.com/llvm/llvm-project/commit/0249554ee1ac49e6f1d93fa78a55971fc706f635),
@HerrCai0907 .
There may be more things to fix.
https:/
https://github.com/carlosgalvezp approved this pull request.
LGTM.
In the future, please provide more details about exactly which tool you are
using, which you call "sanitizer". For example, what is the name of the tool?
"sanitizers" are tools to detect issues at runtime; here you are using a
https://github.com/carlosgalvezp created
https://github.com/llvm/llvm-project/pull/141209
It is deemed more of an annoyance than a help, since the patterns the check
warns about are quite common and idiomatic in C, and there are no good
alternatives.
Thus, enable the check only for C++, where
carlosgalvezp wrote:
You can check the discussion in the linked issue. The argument is that these
casts are idiomatic in C, and does not make sense to pollute the code with
casts. There's no other safer alternative either.
> then probably they should just disable a check
There doesn't appear
https://github.com/carlosgalvezp requested changes to this pull request.
Why are the fixes being removed? CHECK-FIXES is not equivalent to
CHECK-MESSAGES-NOT
https://github.com/llvm/llvm-project/pull/140753
___
cfe-commits mailing list
cfe-commits@lis
carlosgalvezp wrote:
Also, CHECK-MESSAGES-NOT is discouraged, since the testing framework already
checked that no other output is produced by default.
https://github.com/llvm/llvm-project/pull/140753
___
cfe-commits mailing list
cfe-commits@lists.llvm
carlosgalvezp wrote:
Apologies for the delay, I will review during this week!
https://github.com/llvm/llvm-project/pull/136167
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -113,7 +113,7 @@ struct UnqualNameVisitor : public
RecursiveASTVisitor {
};
} // namespace
-constexpr llvm::StringLiteral Message =
+constexpr llvm::StringLiteral MessageFunction =
carlosgalvezp wrote:
Nit: I think the name was clearer before. I read this
@@ -383,6 +382,10 @@ void UseTrailingReturnTypeCheck::keepSpecifiers(
}
}
+UseTrailingReturnTypeCheck::UseTrailingReturnTypeCheck(
carlosgalvezp wrote:
Nit: typically we keep these in the header in this case, since it's just 1 more
line in the header, comp
https://github.com/carlosgalvezp approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/140753
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
carlosgalvezp wrote:
Thanks, I didn't notice they were the same. In that case they should be removed
and have nothing. Optionally one can add a human-readable comment like "Should
not trigger here" or something, but it's not necessary.
https://github.com/llvm/llvm-project/pull/140753
_
https://github.com/carlosgalvezp closed
https://github.com/llvm/llvm-project/pull/140753
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/carlosgalvezp approved this pull request.
LGTM!
https://github.com/llvm/llvm-project/pull/140759
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -113,7 +113,7 @@ struct UnqualNameVisitor : public
RecursiveASTVisitor {
};
} // namespace
-constexpr llvm::StringLiteral Message =
+constexpr llvm::StringLiteral MessageFunction =
carlosgalvezp wrote:
Ok! I think this change would have been better to do
https://github.com/carlosgalvezp created
https://github.com/llvm/llvm-project/pull/140520
The docs of the check state:
> Glibc’s list is compiled from GNU web documentation with a search for MT-Safe
> tag
And strerror fulfills exactly that:
https://www.gnu.org/software/libc/manual/html_node/
https://github.com/carlosgalvezp updated
https://github.com/llvm/llvm-project/pull/140520
>From 35769db674fc2ebe7c0dda9ed329806b8b059414 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20G=C3=A1lvez?=
Date: Mon, 19 May 2025 09:35:30 +
Subject: [PATCH 1/2] [clang-tidy] Do not flag strerror i
https://github.com/carlosgalvezp closed
https://github.com/llvm/llvm-project/pull/140520
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -46,20 +46,65 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) {
FileOptionsProvider FileOpt({}, {}, {}, FileSystem);
- ClangTidyOptions File1Options =
+ llvm::ErrorOr File1Options =
FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp");
- ClangTidyOptions F
@@ -265,8 +265,16 @@ const ClangTidyOptions &ClangTidyContext::getOptions()
const {
ClangTidyOptions ClangTidyContext::getOptionsForFile(StringRef File) const {
// Merge options on top of getDefaults() as a safeguard against options with
// unset values.
- return ClangTid
@@ -46,20 +46,65 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) {
FileOptionsProvider FileOpt({}, {}, {}, FileSystem);
- ClangTidyOptions File1Options =
+ llvm::ErrorOr File1Options =
FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp");
- ClangTidyOptions F
https://github.com/carlosgalvezp edited
https://github.com/llvm/llvm-project/pull/136167
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -46,20 +46,20 @@ TEST(ClangTidyOptionsProvider, InMemoryFileSystems) {
FileOptionsProvider FileOpt({}, {}, {}, FileSystem);
- ClangTidyOptions File1Options =
+ llvm::ErrorOr File1Options =
FileOpt.getOptions("ProjectRoot/SubDir1/File.cpp");
- ClangTidyOptions F
501 - 542 of 542 matches
Mail list logo