Skip to content

Commit 1d672ba

Browse files
committed
Merge branch 'main' into clang-pointer-auth-basic-declarations
2 parents e3cb910 + 0c032fd commit 1d672ba

File tree

2,406 files changed

+92228
-38455
lines changed

Some content is hidden

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

2,406 files changed

+92228
-38455
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function add-dependencies() {
108108
compiler-rt|libc|openmp)
109109
echo clang lld
110110
;;
111-
flang|lldb)
111+
flang|lldb|libclc)
112112
for p in llvm clang; do
113113
echo $p
114114
done

.github/CODEOWNERS

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,15 @@ clang/test/AST/Interp/ @tbaederr
113113

114114
# MLIR NVVM Dialect in MLIR
115115
/mlir/**/LLVMIR/**/BasicPtxBuilderInterface* @grypp
116-
/mlir/**/NVVM*/ @grypp
116+
/mlir/**/NVVM* @grypp
117117

118118
# MLIR Python Bindings
119-
/mlir/test/python/ @makslevental @stellaraccident
120-
/mlir/python/ @makslevental @stellaraccident
119+
/mlir/test/python/ @ftynse @makslevental @stellaraccident
120+
/mlir/python/ @ftynse @makslevental @stellaraccident
121+
122+
# MLIR Mem2Reg/SROA
123+
/mlir/**/Transforms/Mem2Reg.* @moxinilian
124+
/mlir/**/Transforms/SROA.* @moxinilian
121125

122126
# BOLT
123127
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci

.github/new-prs-labeler.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
ClangIR:
2+
- clang/include/clang/CIR/**/*
3+
- clang/lib/CIR/**/*
4+
- clang/tools/cir-*/**/*
5+
- clang/test/CIR/**/*
6+
17
clang:dataflow:
28
- clang/include/clang/Analysis/FlowSensitive/**/*
39
- clang/lib/Analysis/FlowSensitive/**/*
@@ -938,3 +944,6 @@ openmp:libomptarget:
938944

939945
bazel:
940946
- utils/bazel/**
947+
948+
offload:
949+
- offload/**

.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/add_new_check.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def adapt_module(module_path, module, check_name, check_name_camel):
211211
f.write(check_decl)
212212
else:
213213
match = re.search(
214-
'registerCheck<(.*)> *\( *(?:"([^"]*)")?', line
214+
r'registerCheck<(.*)> *\( *(?:"([^"]*)")?', line
215215
)
216216
prev_line = None
217217
if match:
@@ -383,7 +383,7 @@ def filename_from_module(module_name, check_name):
383383
if stmt_start_pos == -1:
384384
return ""
385385
stmt = code[stmt_start_pos + 1 : stmt_end_pos]
386-
matches = re.search('registerCheck<([^>:]*)>\(\s*"([^"]*)"\s*\)', stmt)
386+
matches = re.search(r'registerCheck<([^>:]*)>\(\s*"([^"]*)"\s*\)', stmt)
387387
if matches and matches[2] == full_check_name:
388388
class_name = matches[1]
389389
if "::" in class_name:
@@ -401,8 +401,8 @@ def filename_from_module(module_name, check_name):
401401
# Examine code looking for a c'tor definition to get the base class name.
402402
def get_base_class(code, check_file):
403403
check_class_name = os.path.splitext(os.path.basename(check_file))[0]
404-
ctor_pattern = check_class_name + "\([^:]*\)\s*:\s*([A-Z][A-Za-z0-9]*Check)\("
405-
matches = re.search("\s+" + check_class_name + "::" + ctor_pattern, code)
404+
ctor_pattern = check_class_name + r"\([^:]*\)\s*:\s*([A-Z][A-Za-z0-9]*Check)\("
405+
matches = re.search(r"\s+" + check_class_name + "::" + ctor_pattern, code)
406406

407407
# The constructor might be inline in the header.
408408
if not matches:
@@ -476,7 +476,7 @@ def process_doc(doc_file):
476476
# Orphan page, don't list it.
477477
return "", ""
478478

479-
match = re.search(".*:http-equiv=refresh: \d+;URL=(.*).html(.*)", content)
479+
match = re.search(r".*:http-equiv=refresh: \d+;URL=(.*).html(.*)", content)
480480
# Is it a redirect?
481481
return check_name, match
482482

@@ -505,7 +505,7 @@ def format_link_alias(doc_file):
505505
ref_begin = ""
506506
ref_end = "_"
507507
else:
508-
redirect_parts = re.search("^\.\./([^/]*)/([^/]*)$", match.group(1))
508+
redirect_parts = re.search(r"^\.\./([^/]*)/([^/]*)$", match.group(1))
509509
title = redirect_parts[1] + "-" + redirect_parts[2]
510510
target = redirect_parts[1] + "/" + redirect_parts[2]
511511
autofix = has_auto_fix(title)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void ForwardingReferenceOverloadCheck::registerMatchers(MatchFinder *Finder) {
7272

7373
DeclarationMatcher FindOverload =
7474
cxxConstructorDecl(
75-
hasParameter(0, ForwardingRefParm),
75+
hasParameter(0, ForwardingRefParm), unless(isDeleted()),
7676
unless(hasAnyParameter(
7777
// No warning: enable_if as constructor parameter.
7878
parmVarDecl(hasType(isEnableIf())))),

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/cppcoreguidelines/ProTypeMemberInitCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void ProTypeMemberInitCheck::checkMissingMemberInitializer(
444444
if (!F->hasInClassInitializer() &&
445445
utils::type_traits::isTriviallyDefaultConstructible(F->getType(),
446446
Context) &&
447-
!isEmpty(Context, F->getType()) && !F->isUnnamedBitfield() &&
447+
!isEmpty(Context, F->getType()) && !F->isUnnamedBitField() &&
448448
!AnyMemberHasInitPerUnion)
449449
FieldsToInit.insert(F);
450450
});

clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ getAllNamedFields(const CXXRecordDecl *Record) {
2626
std::set<const FieldDecl *> Result;
2727
for (const auto *Field : Record->fields()) {
2828
// Static data members are not in this range.
29-
if (Field->isUnnamedBitfield())
29+
if (Field->isUnnamedBitField())
3030
continue;
3131
Result.insert(Field);
3232
}

0 commit comments

Comments
 (0)