Skip to content

Commit e7eb1fe

Browse files
committed
Merge branch 'main' into pgo-estimated-trip-count
2 parents f0ff2e2 + 6129e4c commit e7eb1fe

File tree

2,495 files changed

+93636
-37305
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,495 files changed

+93636
-37305
lines changed

.ci/utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ function at-exit {
2626
mkdir -p artifacts
2727
sccache --show-stats >> artifacts/sccache_stats.txt
2828
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
29+
cp "${MONOREPO_ROOT}"/*.log artifacts/ || :
2930
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
3031

3132
# If building fails there will be no results files.
3233
shopt -s nullglob
3334

3435
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
3536
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
36-
$retcode "${BUILD_DIR}"/test-results.*.xml "${BUILD_DIR}"/ninja*.log \
37+
$retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \
3738
>> $GITHUB_STEP_SUMMARY
3839
fi
3940
}

.git-blame-ignore-revs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,3 @@ a3a007ad5fa20abc90ead4e1030b481bf109b4cf
143143
b7e332d3f59f567b1999fbcc660d7837cba8e406
144144
6056f942abe83b05406df8b04e95ec37a3d160b5
145145
906295b8a31c8dac5aa845864c0bca9f02f86184
146-
147-
# [mlir][tensor][linalg] Move Pack/UnPack Ops to Linalg
148-
517800e37e8d3a4ee84214bef65e227612c2a98b

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ concurrency:
3636
jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
39-
runs-on: llvm-premerge-libcxx-runners
39+
runs-on: llvm-premerge-libcxx-next-runners
4040
continue-on-error: false
4141
strategy:
4242
fail-fast: false
@@ -47,8 +47,8 @@ jobs:
4747
'generic-cxx26',
4848
'generic-modules'
4949
]
50-
cc: [ 'clang-21' ]
51-
cxx: [ 'clang++-21' ]
50+
cc: [ 'clang-22' ]
51+
cxx: [ 'clang++-22' ]
5252
include:
5353
- config: 'generic-gcc'
5454
cc: 'gcc-15'
@@ -73,7 +73,7 @@ jobs:
7373
**/crash_diagnostics/*
7474
stage2:
7575
if: github.repository_owner == 'llvm'
76-
runs-on: llvm-premerge-libcxx-runners
76+
runs-on: llvm-premerge-libcxx-next-runners
7777
needs: [ stage1 ]
7878
continue-on-error: false
7979
strategy:
@@ -86,18 +86,18 @@ jobs:
8686
'generic-cxx20',
8787
'generic-cxx23'
8888
]
89-
cc: [ 'clang-21' ]
90-
cxx: [ 'clang++-21' ]
89+
cc: [ 'clang-22' ]
90+
cxx: [ 'clang++-22' ]
9191
include:
9292
- config: 'generic-gcc-cxx11'
9393
cc: 'gcc-15'
9494
cxx: 'g++-15'
95+
- config: 'generic-cxx26'
96+
cc: 'clang-21'
97+
cxx: 'clang++-21'
9598
- config: 'generic-cxx26'
9699
cc: 'clang-20'
97100
cxx: 'clang++-20'
98-
- config: 'generic-cxx26'
99-
cc: 'clang-19'
100-
cxx: 'clang++-19'
101101
steps:
102102
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103103
- name: ${{ matrix.config }}
@@ -148,27 +148,27 @@ jobs:
148148
'generic-static',
149149
'bootstrapping-build'
150150
]
151-
machine: [ 'llvm-premerge-libcxx-runners' ]
151+
machine: [ 'llvm-premerge-libcxx-next-runners' ]
152152
include:
153153
- config: 'generic-cxx26'
154-
machine: llvm-premerge-libcxx-runners
154+
machine: llvm-premerge-libcxx-next-runners
155155
- config: 'generic-asan'
156-
machine: llvm-premerge-libcxx-runners
156+
machine: llvm-premerge-libcxx-next-runners
157157
- config: 'generic-tsan'
158-
machine: llvm-premerge-libcxx-runners
158+
machine: llvm-premerge-libcxx-next-runners
159159
- config: 'generic-ubsan'
160-
machine: llvm-premerge-libcxx-runners
160+
machine: llvm-premerge-libcxx-next-runners
161161
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
162162
- config: 'generic-msan'
163-
machine: llvm-premerge-libcxx-runners
163+
machine: llvm-premerge-libcxx-next-runners
164164
runs-on: ${{ matrix.machine }}
165165
steps:
166166
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
167167
- name: ${{ matrix.config }}
168168
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
169169
env:
170-
CC: clang-21
171-
CXX: clang++-21
170+
CC: clang-22
171+
CXX: clang++-22
172172
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
173173
if: always()
174174
with:

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,9 @@ llvm::SmallVector<llvm::StringRef, 4> splitSymbolName(llvm::StringRef Name) {
3131
return Splitted;
3232
}
3333

34-
SourceLocation startLocationForType(TypeLoc TLoc) {
35-
// For elaborated types (e.g. `struct a::A`) we want the portion after the
36-
// `struct` but including the namespace qualifier, `a::`.
37-
if (TLoc.getTypeLocClass() == TypeLoc::Elaborated) {
38-
NestedNameSpecifierLoc NestedNameSpecifier =
39-
TLoc.castAs<ElaboratedTypeLoc>().getQualifierLoc();
40-
if (NestedNameSpecifier.getNestedNameSpecifier())
41-
return NestedNameSpecifier.getBeginLoc();
42-
TLoc = TLoc.getNextTypeLoc();
43-
}
44-
return TLoc.getBeginLoc();
45-
}
46-
4734
SourceLocation endLocationForType(TypeLoc TLoc) {
48-
// Dig past any namespace or keyword qualifications.
49-
while (TLoc.getTypeLocClass() == TypeLoc::Elaborated ||
50-
TLoc.getTypeLocClass() == TypeLoc::Qualified)
51-
TLoc = TLoc.getNextTypeLoc();
35+
if (auto QTL = TLoc.getAs<QualifiedTypeLoc>())
36+
TLoc = QTL.getUnqualifiedLoc();
5237

5338
// The location for template specializations (e.g. Foo<int>) includes the
5439
// templated types in its location range. We want to restrict this to just
@@ -550,8 +535,8 @@ void ChangeNamespaceTool::run(
550535
Result.Nodes.getNodeAs<NestedNameSpecifierLoc>(
551536
"nested_specifier_loc")) {
552537
SourceLocation Start = Specifier->getBeginLoc();
553-
SourceLocation End = endLocationForType(Specifier->getTypeLoc());
554-
fixTypeLoc(Result, Start, End, Specifier->getTypeLoc());
538+
SourceLocation End = endLocationForType(Specifier->castAsTypeLoc());
539+
fixTypeLoc(Result, Start, End, Specifier->castAsTypeLoc());
555540
} else if (const auto *BaseInitializer =
556541
Result.Nodes.getNodeAs<CXXCtorInitializer>(
557542
"base_initializer")) {
@@ -562,19 +547,16 @@ void ChangeNamespaceTool::run(
562547
// filtered by matchers in some cases, e.g. the type is templated. We should
563548
// handle the record type qualifier instead.
564549
TypeLoc Loc = *TLoc;
565-
while (Loc.getTypeLocClass() == TypeLoc::Qualified)
566-
Loc = Loc.getNextTypeLoc();
567-
if (Loc.getTypeLocClass() == TypeLoc::Elaborated) {
568-
NestedNameSpecifierLoc NestedNameSpecifier =
569-
Loc.castAs<ElaboratedTypeLoc>().getQualifierLoc();
570-
// FIXME: avoid changing injected class names.
571-
if (auto *NNS = NestedNameSpecifier.getNestedNameSpecifier()) {
572-
const Type *SpecifierType = NNS->getAsType();
573-
if (SpecifierType && SpecifierType->isRecordType())
574-
return;
575-
}
576-
}
577-
fixTypeLoc(Result, startLocationForType(Loc), endLocationForType(Loc), Loc);
550+
if (auto QTL = Loc.getAs<QualifiedTypeLoc>())
551+
Loc = QTL.getUnqualifiedLoc();
552+
// FIXME: avoid changing injected class names.
553+
if (NestedNameSpecifier NestedNameSpecifier =
554+
Loc.getPrefix().getNestedNameSpecifier();
555+
NestedNameSpecifier.getKind() == NestedNameSpecifier::Kind::Type &&
556+
NestedNameSpecifier.getAsType()->isRecordType())
557+
return;
558+
fixTypeLoc(Result, Loc.getNonElaboratedBeginLoc(), endLocationForType(Loc),
559+
Loc);
578560
} else if (const auto *VarRef =
579561
Result.Nodes.getNodeAs<DeclRefExpr>("var_ref")) {
580562
const auto *Var = Result.Nodes.getNodeAs<VarDecl>("var_decl");
@@ -588,10 +570,9 @@ void ChangeNamespaceTool::run(
588570
} else if (const auto *EnumConstRef =
589571
Result.Nodes.getNodeAs<DeclRefExpr>("enum_const_ref")) {
590572
// Do not rename the reference if it is already scoped by the EnumDecl name.
591-
if (EnumConstRef->hasQualifier() &&
592-
EnumConstRef->getQualifier()->getKind() ==
593-
NestedNameSpecifier::SpecifierKind::TypeSpec &&
594-
EnumConstRef->getQualifier()->getAsType()->isEnumeralType())
573+
if (NestedNameSpecifier Qualifier = EnumConstRef->getQualifier();
574+
Qualifier.getKind() == NestedNameSpecifier::Kind::Type &&
575+
Qualifier.getAsType()->isEnumeralType())
595576
return;
596577
const auto *EnumConstDecl =
597578
Result.Nodes.getNodeAs<EnumConstantDecl>("enum_const_decl");

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,8 @@ parseBases(RecordInfo &I, const CXXRecordDecl *D, bool IsFileInRootDir,
902902
return;
903903
for (const CXXBaseSpecifier &B : D->bases()) {
904904
if (const RecordType *Ty = B.getType()->getAs<RecordType>()) {
905-
if (const CXXRecordDecl *Base =
906-
cast_or_null<CXXRecordDecl>(Ty->getDecl()->getDefinition())) {
905+
if (const CXXRecordDecl *Base = cast_or_null<CXXRecordDecl>(
906+
Ty->getOriginalDecl()->getDefinition())) {
907907
// Initialized without USR and name, this will be set in the following
908908
// if-else stmt.
909909
BaseRecordInfo BI(

clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbols.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ void FindAllSymbols::registerMatchers(MatchFinder *MatchFinder) {
216216
// Uses of most types: just look at what the typeLoc refers to.
217217
MatchFinder->addMatcher(
218218
typeLoc(isExpansionInMainFile(),
219-
loc(qualType(allOf(unless(elaboratedType()),
220-
hasDeclaration(Types.bind("use")))))),
219+
loc(qualType(hasDeclaration(Types.bind("use"))))),
221220
this);
222221
// Uses of typedefs: these are often transparent to hasDeclaration, so we need
223222
// to handle them explicitly.

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ void ClangTidyDiagnosticConsumer::forwardDiagnostic(const Diagnostic &Info) {
533533
Builder << reinterpret_cast<const NamedDecl *>(Info.getRawArg(Index));
534534
break;
535535
case clang::DiagnosticsEngine::ak_nestednamespec:
536-
Builder << reinterpret_cast<NestedNameSpecifier *>(Info.getRawArg(Index));
536+
Builder << NestedNameSpecifier::getFromVoidPointer(
537+
reinterpret_cast<void *>(Info.getRawArg(Index)));
537538
break;
538539
case clang::DiagnosticsEngine::ak_declcontext:
539540
Builder << reinterpret_cast<DeclContext *>(Info.getRawArg(Index));

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ static bool isDerivedClassBefriended(const CXXRecordDecl *CRTP,
4343
return false;
4444
}
4545

46-
return FriendType->getType()->getAsCXXRecordDecl() == Derived;
46+
return declaresSameEntity(FriendType->getType()->getAsCXXRecordDecl(),
47+
Derived);
4748
});
4849
}
4950

@@ -55,7 +56,8 @@ getDerivedParameter(const ClassTemplateSpecializationDecl *CRTP,
5556
CRTP->getTemplateArgs().asArray(), [&](const TemplateArgument &Arg) {
5657
++Idx;
5758
return Arg.getKind() == TemplateArgument::Type &&
58-
Arg.getAsType()->getAsCXXRecordDecl() == Derived;
59+
declaresSameEntity(Arg.getAsType()->getAsCXXRecordDecl(),
60+
Derived);
5961
});
6062

6163
return AnyOf ? CRTP->getSpecializedTemplate()

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ approximateImplicitConversion(const TheCheck &Check, QualType LType,
577577
ImplicitConversionModellingMode ImplicitMode);
578578

579579
static inline bool isUselessSugar(const Type *T) {
580-
return isa<AttributedType, DecayedType, ElaboratedType, ParenType>(T);
580+
return isa<AttributedType, DecayedType, ParenType>(T);
581581
}
582582

583583
namespace {
@@ -1040,7 +1040,9 @@ approximateStandardConversionSequence(const TheCheck &Check, QualType From,
10401040
const auto *ToRecord = To->getAsCXXRecordDecl();
10411041
if (isDerivedToBase(FromRecord, ToRecord)) {
10421042
LLVM_DEBUG(llvm::dbgs() << "--- approximateStdConv. Derived To Base.\n");
1043-
WorkType = QualType{ToRecord->getTypeForDecl(), FastQualifiersToApply};
1043+
WorkType = QualType{
1044+
ToRecord->getASTContext().getCanonicalTagType(ToRecord)->getTypePtr(),
1045+
FastQualifiersToApply};
10441046
}
10451047

10461048
if (Ctx.getLangOpts().CPlusPlus17 && FromPtr && ToPtr) {
@@ -1072,9 +1074,9 @@ approximateStandardConversionSequence(const TheCheck &Check, QualType From,
10721074
WorkType = To;
10731075
}
10741076

1075-
if (WorkType == To) {
1077+
if (Ctx.hasSameType(WorkType, To)) {
10761078
LLVM_DEBUG(llvm::dbgs() << "<<< approximateStdConv. Reached 'To' type.\n");
1077-
return {WorkType};
1079+
return {Ctx.getCommonSugaredType(WorkType, To)};
10781080
}
10791081

10801082
LLVM_DEBUG(llvm::dbgs() << "<<< approximateStdConv. Did not reach 'To'.\n");
@@ -1219,7 +1221,7 @@ tryConversionOperators(const TheCheck &Check, const CXXRecordDecl *RD,
12191221

12201222
if (std::optional<UserDefinedConversionSelector::PreparedConversion>
12211223
SelectedConversion = ConversionSet()) {
1222-
QualType RecordType{RD->getTypeForDecl(), 0};
1224+
CanQualType RecordType = RD->getASTContext().getCanonicalTagType(RD);
12231225

12241226
ConversionSequence Result{RecordType, ToType};
12251227
// The conversion from the operator call's return type to ToType was
@@ -1270,7 +1272,7 @@ tryConvertingConstructors(const TheCheck &Check, QualType FromType,
12701272

12711273
if (std::optional<UserDefinedConversionSelector::PreparedConversion>
12721274
SelectedConversion = ConversionSet()) {
1273-
QualType RecordType{RD->getTypeForDecl(), 0};
1275+
CanQualType RecordType = RD->getASTContext().getCanonicalTagType(RD);
12741276

12751277
ConversionSequence Result{FromType, RecordType};
12761278
Result.AfterFirstStandard = SelectedConversion->Seq.AfterFirstStandard;

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ void ForwardDeclarationNamespaceCheck::check(
6969
// struct B { friend A; };
7070
// \endcode
7171
// `A` will not be marked as "referenced" in the AST.
72-
if (const TypeSourceInfo *Tsi = Decl->getFriendType()) {
73-
QualType Desugared = Tsi->getType().getDesugaredType(*Result.Context);
74-
FriendTypes.insert(Desugared.getTypePtr());
75-
}
72+
if (const TypeSourceInfo *Tsi = Decl->getFriendType())
73+
FriendTypes.insert(
74+
Tsi->getType()->getCanonicalTypeUnqualified().getTypePtr());
7675
}
7776
}
7877

@@ -119,7 +118,9 @@ void ForwardDeclarationNamespaceCheck::onEndOfTranslationUnit() {
119118
if (CurDecl->hasDefinition() || CurDecl->isReferenced()) {
120119
continue; // Skip forward declarations that are used/referenced.
121120
}
122-
if (FriendTypes.contains(CurDecl->getTypeForDecl())) {
121+
if (FriendTypes.contains(CurDecl->getASTContext()
122+
.getCanonicalTagType(CurDecl)
123+
->getTypePtr())) {
123124
continue; // Skip forward declarations referenced as friend.
124125
}
125126
if (CurDecl->getLocation().isMacroID() ||

0 commit comments

Comments
 (0)