Skip to content

Commit 704a45d

Browse files
committed
[𝘀𝗽𝗿] changes introduced through rebase
Created using spr 1.3.4 [skip ci]
2 parents 2203cc6 + dc8f6a8 commit 704a45d

File tree

1,558 files changed

+53866
-21933
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,558 files changed

+53866
-21933
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ clang/test/AST/Interp/ @tbaederr
119119
/mlir/test/python/ @ftynse @makslevental @stellaraccident
120120
/mlir/python/ @ftynse @makslevental @stellaraccident
121121

122+
# MLIR Mem2Reg/SROA
123+
/mlir/**/Transforms/Mem2Reg.* @moxinilian
124+
/mlir/**/Transforms/SROA.* @moxinilian
125+
122126
# BOLT
123127
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci
124128

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,17 @@ jobs:
6161
]
6262
cc: [ 'clang-19' ]
6363
cxx: [ 'clang++-19' ]
64-
clang_tidy: [ 'ON' ]
6564
include:
6665
- config: 'generic-gcc'
6766
cc: 'gcc-13'
6867
cxx: 'g++-13'
69-
clang_tidy: 'OFF'
7068
steps:
7169
- uses: actions/checkout@v4
7270
- name: ${{ matrix.config }}.${{ matrix.cxx }}
7371
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
7472
env:
7573
CC: ${{ matrix.cc }}
7674
CXX: ${{ matrix.cxx }}
77-
ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
7875
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
7976
if: always()
8077
with:
@@ -102,28 +99,23 @@ jobs:
10299
]
103100
cc: [ 'clang-19' ]
104101
cxx: [ 'clang++-19' ]
105-
clang_tidy: [ 'ON' ]
106102
include:
107103
- config: 'generic-gcc-cxx11'
108104
cc: 'gcc-13'
109105
cxx: 'g++-13'
110-
clang_tidy: 'OFF'
111106
- config: 'generic-cxx23'
112107
cc: 'clang-17'
113108
cxx: 'clang++-17'
114-
clang_tidy: 'OFF'
115109
- config: 'generic-cxx26'
116110
cc: 'clang-18'
117111
cxx: 'clang++-18'
118-
clang_tidy: 'ON'
119112
steps:
120113
- uses: actions/checkout@v4
121114
- name: ${{ matrix.config }}
122115
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
123116
env:
124117
CC: ${{ matrix.cc }}
125118
CXX: ${{ matrix.cxx }}
126-
ENABLE_CLANG_TIDY: ${{ matrix.clang_tidy }}
127119
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
128120
if: always() # Upload artifacts even if the build or test suite fails
129121
with:
@@ -188,7 +180,6 @@ jobs:
188180
env:
189181
CC: clang-19
190182
CXX: clang++-19
191-
ENABLE_CLANG_TIDY: "OFF"
192183
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
193184
if: always()
194185
with:

bolt/test/AArch64/constant_island_pie_update.s

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# RUN: llvm-objdump -j .text -d --show-all-symbols %t.relr.bolt | FileCheck %s
1919
# RUN: llvm-objdump -j .text -d %t.relr.bolt | \
2020
# RUN: FileCheck %s --check-prefix=ADDENDCHECK
21-
# RUN: llvm-readelf -rsW %t.relr.bolt | FileCheck --check-prefix=ELFCHECK %s
21+
# RUN: llvm-readelf -rsW %t.relr.bolt | FileCheck --check-prefix=RELRELFCHECK %s
2222
# RUN: llvm-readelf -SW %t.relr.bolt | FileCheck --check-prefix=RELRSZCHECK %s
2323

2424
// Check that the CI value was updated
@@ -51,6 +51,12 @@
5151
# ELFCHECK-NEXT: {{.*}} R_AARCH64_RELATIVE
5252
# ELFCHECK: {{.*}}[[#OFF]] {{.*}} $d
5353

54+
# RELRELFCHECK: $d{{$}}
55+
# RELRELFCHECK-NEXT: $d + 0x8{{$}}
56+
# RELRELFCHECK-NEXT: $d + 0x18{{$}}
57+
# RELRELFCHECK-NEXT: mytextP
58+
# RELRELFCHECK-EMPTY:
59+
5460
// Check that .relr.dyn size is 2 bytes to ensure that last 3 relocations were
5561
// encoded as a bitmap so the total section size for 3 relocations is 2 bytes.
5662
# RELRSZCHECK: .relr.dyn RELR [[#%x,ADDR:]] [[#%x,OFF:]] {{0*}}10

clang-tools-extra/clang-doc/Representation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ ClangDocContext::ClangDocContext(tooling::ExecutionContext *ECtx,
380380
this->SourceRoot = std::string(SourceRootDir);
381381
if (!RepositoryUrl.empty()) {
382382
this->RepositoryUrl = std::string(RepositoryUrl);
383-
if (!RepositoryUrl.empty() && RepositoryUrl.find("http://") != 0 &&
384-
RepositoryUrl.find("https://") != 0)
383+
if (!RepositoryUrl.empty() && !RepositoryUrl.starts_with("http://") &&
384+
!RepositoryUrl.starts_with("https://"))
385385
this->RepositoryUrl->insert(0, "https://");
386386
}
387387
}

clang-tools-extra/clang-tidy/ClangTidyCheck.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ void ClangTidyCheck::OptionsView::storeInt(ClangTidyOptions::OptionMap &Options,
139139
store(Options, LocalName, llvm::itostr(Value));
140140
}
141141

142+
void ClangTidyCheck::OptionsView::storeUnsigned(
143+
ClangTidyOptions::OptionMap &Options, StringRef LocalName,
144+
uint64_t Value) const {
145+
store(Options, LocalName, llvm::utostr(Value));
146+
}
147+
142148
template <>
143149
void ClangTidyCheck::OptionsView::store<bool>(
144150
ClangTidyOptions::OptionMap &Options, StringRef LocalName,

clang-tools-extra/clang-tidy/ClangTidyCheck.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,10 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback {
411411
std::enable_if_t<std::is_integral_v<T>>
412412
store(ClangTidyOptions::OptionMap &Options, StringRef LocalName,
413413
T Value) const {
414-
storeInt(Options, LocalName, Value);
414+
if constexpr (std::is_signed_v<T>)
415+
storeInt(Options, LocalName, Value);
416+
else
417+
storeUnsigned(Options, LocalName, Value);
415418
}
416419

417420
/// Stores an option with the check-local name \p LocalName with
@@ -422,7 +425,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback {
422425
store(ClangTidyOptions::OptionMap &Options, StringRef LocalName,
423426
std::optional<T> Value) const {
424427
if (Value)
425-
storeInt(Options, LocalName, *Value);
428+
store(Options, LocalName, *Value);
426429
else
427430
store(Options, LocalName, "none");
428431
}
@@ -470,6 +473,8 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback {
470473
void storeInt(ClangTidyOptions::OptionMap &Options, StringRef LocalName,
471474
int64_t Value) const;
472475

476+
void storeUnsigned(ClangTidyOptions::OptionMap &Options,
477+
StringRef LocalName, uint64_t Value) const;
473478

474479
std::string NamePrefix;
475480
const ClangTidyOptions::OptionMap &CheckOptions;

clang-tools-extra/clang-tidy/GlobList.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ static bool consumeNegativeIndicator(StringRef &GlobList) {
1919
return GlobList.consume_front("-");
2020
}
2121

22-
// Converts first glob from the comma-separated list of globs to Regex and
23-
// removes it and the trailing comma from the GlobList.
24-
static llvm::Regex consumeGlob(StringRef &GlobList) {
22+
// Extracts the first glob from the comma-separated list of globs,
23+
// removes it and the trailing comma from the GlobList and
24+
// returns the extracted glob.
25+
static llvm::StringRef extractNextGlob(StringRef &GlobList) {
2526
StringRef UntrimmedGlob = GlobList.substr(0, GlobList.find_first_of(",\n"));
2627
StringRef Glob = UntrimmedGlob.trim();
2728
GlobList = GlobList.substr(UntrimmedGlob.size() + 1);
29+
return Glob;
30+
}
31+
32+
static llvm::Regex createRegexFromGlob(StringRef &Glob) {
2833
SmallString<128> RegexText("^");
2934
StringRef MetaChars("()^$|*+?.[]\\{}");
3035
for (char C : Glob) {
@@ -43,7 +48,8 @@ GlobList::GlobList(StringRef Globs, bool KeepNegativeGlobs /* =true */) {
4348
do {
4449
GlobListItem Item;
4550
Item.IsPositive = !consumeNegativeIndicator(Globs);
46-
Item.Regex = consumeGlob(Globs);
51+
Item.Text = extractNextGlob(Globs);
52+
Item.Regex = createRegexFromGlob(Item.Text);
4753
if (Item.IsPositive || KeepNegativeGlobs)
4854
Items.push_back(std::move(Item));
4955
} while (!Globs.empty());

clang-tools-extra/clang-tidy/GlobList.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ class GlobList {
4444
struct GlobListItem {
4545
bool IsPositive;
4646
llvm::Regex Regex;
47+
llvm::StringRef Text;
4748
};
4849
SmallVector<GlobListItem, 0> Items;
50+
51+
public:
52+
const SmallVectorImpl<GlobListItem> &getItems() const { return Items; };
4953
};
5054

5155
/// A \p GlobList that caches search results, so that search is performed only

clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
#include "LambdaFunctionNameCheck.h"
1010
#include "clang/AST/ASTContext.h"
11+
#include "clang/AST/DeclCXX.h"
1112
#include "clang/ASTMatchers/ASTMatchFinder.h"
13+
#include "clang/ASTMatchers/ASTMatchers.h"
1214
#include "clang/Frontend/CompilerInstance.h"
1315
#include "clang/Lex/MacroInfo.h"
1416
#include "clang/Lex/Preprocessor.h"
@@ -56,6 +58,8 @@ class MacroExpansionsWithFileAndLine : public PPCallbacks {
5658
LambdaFunctionNameCheck::SourceRangeSet* SuppressMacroExpansions;
5759
};
5860

61+
AST_MATCHER(CXXMethodDecl, isInLambda) { return Node.getParent()->isLambda(); }
62+
5963
} // namespace
6064

6165
LambdaFunctionNameCheck::LambdaFunctionNameCheck(StringRef Name,
@@ -69,9 +73,13 @@ void LambdaFunctionNameCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
6973
}
7074

7175
void LambdaFunctionNameCheck::registerMatchers(MatchFinder *Finder) {
72-
// Match on PredefinedExprs inside a lambda.
73-
Finder->addMatcher(predefinedExpr(hasAncestor(lambdaExpr())).bind("E"),
74-
this);
76+
Finder->addMatcher(
77+
cxxMethodDecl(isInLambda(),
78+
hasBody(forEachDescendant(
79+
predefinedExpr(hasAncestor(cxxMethodDecl().bind("fn")))
80+
.bind("E"))),
81+
equalsBoundNode("fn")),
82+
this);
7583
}
7684

7785
void LambdaFunctionNameCheck::registerPPCallbacks(

clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -454,52 +454,27 @@ static constexpr StringLiteral VerifyConfigWarningEnd = " [-verify-config]\n";
454454

455455
static bool verifyChecks(const StringSet<> &AllChecks, StringRef CheckGlob,
456456
StringRef Source) {
457-
llvm::StringRef Cur, Rest;
457+
GlobList Globs(CheckGlob);
458458
bool AnyInvalid = false;
459-
for (std::tie(Cur, Rest) = CheckGlob.split(',');
460-
!(Cur.empty() && Rest.empty()); std::tie(Cur, Rest) = Rest.split(',')) {
461-
Cur = Cur.trim();
462-
if (Cur.empty())
459+
for (const auto &Item : Globs.getItems()) {
460+
if (Item.Text.starts_with("clang-diagnostic"))
463461
continue;
464-
Cur.consume_front("-");
465-
if (Cur.starts_with("clang-diagnostic"))
466-
continue;
467-
if (Cur.contains('*')) {
468-
SmallString<128> RegexText("^");
469-
StringRef MetaChars("()^$|*+?.[]\\{}");
470-
for (char C : Cur) {
471-
if (C == '*')
472-
RegexText.push_back('.');
473-
else if (MetaChars.contains(C))
474-
RegexText.push_back('\\');
475-
RegexText.push_back(C);
476-
}
477-
RegexText.push_back('$');
478-
llvm::Regex Glob(RegexText);
479-
std::string Error;
480-
if (!Glob.isValid(Error)) {
481-
AnyInvalid = true;
482-
llvm::WithColor::error(llvm::errs(), Source)
483-
<< "building check glob '" << Cur << "' " << Error << "'\n";
484-
continue;
485-
}
486-
if (llvm::none_of(AllChecks.keys(),
487-
[&Glob](StringRef S) { return Glob.match(S); })) {
488-
AnyInvalid = true;
462+
if (llvm::none_of(AllChecks.keys(),
463+
[&Item](StringRef S) { return Item.Regex.match(S); })) {
464+
AnyInvalid = true;
465+
if (Item.Text.contains('*'))
489466
llvm::WithColor::warning(llvm::errs(), Source)
490-
<< "check glob '" << Cur << "' doesn't match any known check"
467+
<< "check glob '" << Item.Text << "' doesn't match any known check"
491468
<< VerifyConfigWarningEnd;
469+
else {
470+
llvm::raw_ostream &Output =
471+
llvm::WithColor::warning(llvm::errs(), Source)
472+
<< "unknown check '" << Item.Text << '\'';
473+
llvm::StringRef Closest = closest(Item.Text, AllChecks);
474+
if (!Closest.empty())
475+
Output << "; did you mean '" << Closest << '\'';
476+
Output << VerifyConfigWarningEnd;
492477
}
493-
} else {
494-
if (AllChecks.contains(Cur))
495-
continue;
496-
AnyInvalid = true;
497-
llvm::raw_ostream &Output = llvm::WithColor::warning(llvm::errs(), Source)
498-
<< "unknown check '" << Cur << '\'';
499-
llvm::StringRef Closest = closest(Cur, AllChecks);
500-
if (!Closest.empty())
501-
Output << "; did you mean '" << Closest << '\'';
502-
Output << VerifyConfigWarningEnd;
503478
}
504479
}
505480
return AnyInvalid;

clang-tools-extra/clangd/unittests/FindTargetTests.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ TEST_F(TargetDeclTest, Types) {
427427
[[auto]] X = S{};
428428
)cpp";
429429
// FIXME: deduced type missing in AST. https://llvm.org/PR42914
430-
EXPECT_DECLS("AutoTypeLoc");
430+
EXPECT_DECLS("AutoTypeLoc", );
431431

432432
Code = R"cpp(
433433
template <typename... E>
@@ -727,13 +727,13 @@ TEST_F(TargetDeclTest, BuiltinTemplates) {
727727
template <class T, int N>
728728
using make_integer_sequence = [[__make_integer_seq]]<integer_sequence, T, N>;
729729
)cpp";
730-
EXPECT_DECLS("TemplateSpecializationTypeLoc");
730+
EXPECT_DECLS("TemplateSpecializationTypeLoc", );
731731

732732
Code = R"cpp(
733733
template <int N, class... Pack>
734734
using type_pack_element = [[__type_pack_element]]<N, Pack...>;
735735
)cpp";
736-
EXPECT_DECLS("TemplateSpecializationTypeLoc");
736+
EXPECT_DECLS("TemplateSpecializationTypeLoc", );
737737
}
738738

739739
TEST_F(TargetDeclTest, MemberOfTemplate) {
@@ -1018,7 +1018,7 @@ TEST_F(TargetDeclTest, DependentTypes) {
10181018
typedef typename waldo<N - 1>::type::[[next]] type;
10191019
};
10201020
)cpp";
1021-
EXPECT_DECLS("DependentNameTypeLoc");
1021+
EXPECT_DECLS("DependentNameTypeLoc", );
10221022

10231023
// Similar to above but using mutually recursive templates.
10241024
Code = R"cpp(
@@ -1035,7 +1035,7 @@ TEST_F(TargetDeclTest, DependentTypes) {
10351035
using type = typename even<N - 1>::type::[[next]];
10361036
};
10371037
)cpp";
1038-
EXPECT_DECLS("DependentNameTypeLoc");
1038+
EXPECT_DECLS("DependentNameTypeLoc", );
10391039
}
10401040

10411041
TEST_F(TargetDeclTest, TypedefCascade) {
@@ -1263,14 +1263,14 @@ TEST_F(TargetDeclTest, ObjC) {
12631263
+ ([[id]])sharedInstance;
12641264
@end
12651265
)cpp";
1266-
EXPECT_DECLS("TypedefTypeLoc");
1266+
EXPECT_DECLS("TypedefTypeLoc", );
12671267

12681268
Code = R"cpp(
12691269
@interface Foo
12701270
+ ([[instancetype]])sharedInstance;
12711271
@end
12721272
)cpp";
1273-
EXPECT_DECLS("TypedefTypeLoc");
1273+
EXPECT_DECLS("TypedefTypeLoc", );
12741274
}
12751275

12761276
class FindExplicitReferencesTest : public ::testing::Test {

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ Improvements to clang-tidy
102102
similar fashion to what `-header-filter` does for header files.
103103
- Improved :program:`check_clang_tidy.py` script. Added argument `-export-fixes`
104104
to aid in clang-tidy and test development.
105+
- Fixed bug where big values for unsigned check options overflowed into negative values
106+
when being printed with ``--dump-config``.
107+
108+
- Fixed ``--verify-config`` option not properly parsing checks when using the
109+
literal operator in the ``.clang-tidy`` config.
105110

106111
New checks
107112
^^^^^^^^^^
@@ -155,6 +160,10 @@ Changes in existing checks
155160
<clang-tidy/checks/bugprone/inc-dec-in-conditions>` check to ignore code
156161
within unevaluated contexts, such as ``decltype``.
157162

163+
- Improved :doc:`bugprone-lambda-function-name<clang-tidy/checks/bugprone/lambda-function-name>`
164+
check by ignoring ``__func__`` macro in lambda captures, initializers of
165+
default parameters and nested function declarations.
166+
158167
- Improved :doc:`bugprone-non-zero-enum-to-bool-conversion
159168
<clang-tidy/checks/bugprone/non-zero-enum-to-bool-conversion>` check by
160169
eliminating false positives resulting from direct usage of bitwise operators

0 commit comments

Comments
 (0)