Skip to content

Commit 7326e22

Browse files
committed
[AutoBump] Merge with f7d0370 (Feb 18)
2 parents efd3e89 + f7d0370 commit 7326e22

File tree

214 files changed

+3962
-1621
lines changed

Some content is hidden

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

214 files changed

+3962
-1621
lines changed

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
3939
runs-on: libcxx-self-hosted-linux
40-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
40+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
4141
continue-on-error: false
4242
strategy:
4343
fail-fast: false
@@ -48,8 +48,8 @@ jobs:
4848
'generic-cxx26',
4949
'generic-modules'
5050
]
51-
cc: [ 'clang-20' ]
52-
cxx: [ 'clang++-20' ]
51+
cc: [ 'clang-21' ]
52+
cxx: [ 'clang++-21' ]
5353
include:
5454
- config: 'generic-gcc'
5555
cc: 'gcc-14'
@@ -75,7 +75,7 @@ jobs:
7575
stage2:
7676
if: github.repository_owner == 'llvm'
7777
runs-on: libcxx-self-hosted-linux
78-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
78+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
7979
needs: [ stage1 ]
8080
continue-on-error: false
8181
strategy:
@@ -88,18 +88,22 @@ jobs:
8888
'generic-cxx20',
8989
'generic-cxx23'
9090
]
91-
cc: [ 'clang-20' ]
92-
cxx: [ 'clang++-20' ]
91+
cc: [ 'clang-21' ]
92+
cxx: [ 'clang++-21' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
9595
cc: 'gcc-14'
9696
cxx: 'g++-14'
97-
- config: 'generic-cxx23'
98-
cc: 'clang-18'
99-
cxx: 'clang++-18'
97+
- config: 'generic-cxx26'
98+
cc: 'clang-20'
99+
cxx: 'clang++-20'
100100
- config: 'generic-cxx26'
101101
cc: 'clang-19'
102102
cxx: 'clang++-19'
103+
# Release transition
104+
- config: 'generic-cxx23'
105+
cc: 'clang-18'
106+
cxx: 'clang++-18'
103107
steps:
104108
- uses: actions/checkout@v4
105109
- name: ${{ matrix.config }}
@@ -163,14 +167,14 @@ jobs:
163167
- config: 'generic-msan'
164168
machine: libcxx-self-hosted-linux
165169
runs-on: ${{ matrix.machine }}
166-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
170+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
167171
steps:
168172
- uses: actions/checkout@v4
169173
- name: ${{ matrix.config }}
170174
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171175
env:
172-
CC: clang-20
173-
CXX: clang++-20
176+
CC: clang-21
177+
CXX: clang++-21
174178
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
175179
if: always()
176180
with:

clang/include/clang/AST/DeclBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ class alignas(8) Decl {
492492
/// perform non-Decl specific checks based on the object's type and strict
493493
/// flex array level.
494494
static bool isFlexibleArrayMemberLike(
495-
ASTContext &Context, const Decl *D, QualType Ty,
495+
const ASTContext &Context, const Decl *D, QualType Ty,
496496
LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel,
497497
bool IgnoreTemplateOrMacroSubstitution);
498498

clang/include/clang/AST/Expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ class Expr : public ValueStmt {
542542
/// When IgnoreTemplateOrMacroSubstitution is set, it doesn't consider sizes
543543
/// resulting from the substitution of a macro or a template as special sizes.
544544
bool isFlexibleArrayMemberLike(
545-
ASTContext &Context,
545+
const ASTContext &Context,
546546
LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel,
547547
bool IgnoreTemplateOrMacroSubstitution = false) const;
548548

clang/lib/AST/ASTContext.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,7 +3898,8 @@ QualType ASTContext::getArrayParameterType(QualType Ty) const {
38983898
if (Ty->isArrayParameterType())
38993899
return Ty;
39003900
assert(Ty->isConstantArrayType() && "Ty must be an array type.");
3901-
const auto *ATy = cast<ConstantArrayType>(Ty.getDesugaredType(*this));
3901+
QualType DTy = Ty.getDesugaredType(*this);
3902+
const auto *ATy = cast<ConstantArrayType>(DTy);
39023903
llvm::FoldingSetNodeID ID;
39033904
ATy->Profile(ID, *this, ATy->getElementType(), ATy->getZExtSize(),
39043905
ATy->getSizeExpr(), ATy->getSizeModifier(),
@@ -3910,7 +3911,7 @@ QualType ASTContext::getArrayParameterType(QualType Ty) const {
39103911
return QualType(AT, 0);
39113912

39123913
QualType Canonical;
3913-
if (!Ty.isCanonical()) {
3914+
if (!DTy.isCanonical()) {
39143915
Canonical = getArrayParameterType(getCanonicalType(Ty));
39153916

39163917
// Get the new insert position for the node we care about.

clang/lib/AST/ByteCode/Descriptor.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ static void moveRecord(Block *B, std::byte *Src, std::byte *Dst,
237237
assert(D);
238238
assert(D->ElemRecord);
239239

240-
// FIXME: There might be cases where we need to move over the (v)bases as
241-
// well.
240+
// FIXME: Code duplication.
242241
for (const auto &F : D->ElemRecord->fields()) {
243242
auto FieldOffset = F.Offset;
244243
const auto *SrcDesc =
@@ -250,6 +249,26 @@ static void moveRecord(Block *B, std::byte *Src, std::byte *Dst,
250249
if (auto Fn = F.Desc->MoveFn)
251250
Fn(B, Src + FieldOffset, Dst + FieldOffset, F.Desc);
252251
}
252+
253+
for (const auto &Base : D->ElemRecord->bases()) {
254+
auto BaseOffset = Base.Offset;
255+
const auto *SrcDesc =
256+
reinterpret_cast<const InlineDescriptor *>(Src + BaseOffset) - 1;
257+
auto *DestDesc = reinterpret_cast<InlineDescriptor *>(Dst + BaseOffset) - 1;
258+
std::memcpy(DestDesc, SrcDesc, sizeof(InlineDescriptor));
259+
260+
if (auto Fn = Base.Desc->MoveFn)
261+
Fn(B, Src + BaseOffset, Dst + BaseOffset, Base.Desc);
262+
}
263+
264+
for (const auto &VBase : D->ElemRecord->virtual_bases()) {
265+
auto VBaseOffset = VBase.Offset;
266+
const auto *SrcDesc =
267+
reinterpret_cast<const InlineDescriptor *>(Src + VBaseOffset) - 1;
268+
auto *DestDesc =
269+
reinterpret_cast<InlineDescriptor *>(Dst + VBaseOffset) - 1;
270+
std::memcpy(DestDesc, SrcDesc, sizeof(InlineDescriptor));
271+
}
253272
}
254273

255274
static BlockCtorFn getCtorPrim(PrimType Type) {

clang/lib/AST/DeclBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ bool Decl::isFileContextDecl() const {
438438
}
439439

440440
bool Decl::isFlexibleArrayMemberLike(
441-
ASTContext &Ctx, const Decl *D, QualType Ty,
441+
const ASTContext &Ctx, const Decl *D, QualType Ty,
442442
LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel,
443443
bool IgnoreTemplateOrMacroSubstitution) {
444444
// For compatibility with existing code, we treat arrays of length 0 or

clang/lib/AST/Expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ bool Expr::isKnownToHaveBooleanValue(bool Semantic) const {
203203
}
204204

205205
bool Expr::isFlexibleArrayMemberLike(
206-
ASTContext &Ctx,
206+
const ASTContext &Ctx,
207207
LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel,
208208
bool IgnoreTemplateOrMacroSubstitution) const {
209209
const Expr *E = IgnoreParens();

clang/lib/AST/TextNodeDumper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,6 +2189,11 @@ void TextNodeDumper::VisitEnumDecl(const EnumDecl *D) {
21892189
OS << " __module_private__";
21902190
if (D->isFixed())
21912191
dumpType(D->getIntegerType());
2192+
2193+
if (const auto *Instance = D->getInstantiatedFromMemberEnum()) {
2194+
OS << " instantiated_from";
2195+
dumpPointer(Instance);
2196+
}
21922197
}
21932198

21942199
void TextNodeDumper::VisitRecordDecl(const RecordDecl *D) {

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20723,9 +20723,19 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID,
2072320723
case AMDGPU::BI__builtin_amdgcn_bitop3_b16:
2072420724
return emitBuiltinWithOneOverloadedType<4>(*this, E,
2072520725
Intrinsic::amdgcn_bitop3);
20726-
case AMDGPU::BI__builtin_amdgcn_make_buffer_rsrc:
20727-
return emitBuiltinWithOneOverloadedType<4>(
20728-
*this, E, Intrinsic::amdgcn_make_buffer_rsrc);
20726+
case AMDGPU::BI__builtin_amdgcn_make_buffer_rsrc: {
20727+
// TODO: LLVM has this overloaded to allow for fat pointers, but since
20728+
// those haven't been plumbed through to Clang yet, default to creating the
20729+
// resource type.
20730+
SmallVector<Value *, 4> Args;
20731+
for (unsigned I = 0; I < 4; ++I)
20732+
Args.push_back(EmitScalarExpr(E->getArg(I)));
20733+
llvm::PointerType *RetTy = llvm::PointerType::get(
20734+
Builder.getContext(), llvm::AMDGPUAS::BUFFER_RESOURCE);
20735+
Function *F = CGM.getIntrinsic(Intrinsic::amdgcn_make_buffer_rsrc,
20736+
{RetTy, Args[0]->getType()});
20737+
return Builder.CreateCall(F, Args);
20738+
}
2072920739
case AMDGPU::BI__builtin_amdgcn_raw_buffer_store_b8:
2073020740
case AMDGPU::BI__builtin_amdgcn_raw_buffer_store_b16:
2073120741
case AMDGPU::BI__builtin_amdgcn_raw_buffer_store_b32:

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8879,17 +8879,17 @@ static void emitOffloadingArraysAndArgs(
88798879
};
88808880

88818881
auto CustomMapperCB = [&](unsigned int I) {
8882-
llvm::Value *MFunc = nullptr;
8882+
llvm::Function *MFunc = nullptr;
88838883
if (CombinedInfo.Mappers[I]) {
88848884
Info.HasMapper = true;
88858885
MFunc = CGM.getOpenMPRuntime().getOrCreateUserDefinedMapperFunc(
88868886
cast<OMPDeclareMapperDecl>(CombinedInfo.Mappers[I]));
88878887
}
88888888
return MFunc;
88898889
};
8890-
OMPBuilder.emitOffloadingArraysAndArgs(
8891-
AllocaIP, CodeGenIP, Info, Info.RTArgs, CombinedInfo, IsNonContiguous,
8892-
ForEndCall, DeviceAddrCB, CustomMapperCB);
8890+
cantFail(OMPBuilder.emitOffloadingArraysAndArgs(
8891+
AllocaIP, CodeGenIP, Info, Info.RTArgs, CombinedInfo, CustomMapperCB,
8892+
IsNonContiguous, ForEndCall, DeviceAddrCB));
88938893
}
88948894

88958895
/// Check for inner distribute directive.
@@ -9082,24 +9082,24 @@ void CGOpenMPRuntime::emitUserDefinedMapper(const OMPDeclareMapperDecl *D,
90829082
return CombinedInfo;
90839083
};
90849084

9085-
auto CustomMapperCB = [&](unsigned I, llvm::Function **MapperFunc) {
9085+
auto CustomMapperCB = [&](unsigned I) {
9086+
llvm::Function *MapperFunc = nullptr;
90869087
if (CombinedInfo.Mappers[I]) {
90879088
// Call the corresponding mapper function.
9088-
*MapperFunc = getOrCreateUserDefinedMapperFunc(
9089+
MapperFunc = getOrCreateUserDefinedMapperFunc(
90899090
cast<OMPDeclareMapperDecl>(CombinedInfo.Mappers[I]));
9090-
assert(*MapperFunc && "Expect a valid mapper function is available.");
9091-
return true;
9091+
assert(MapperFunc && "Expect a valid mapper function is available.");
90929092
}
9093-
return false;
9093+
return MapperFunc;
90949094
};
90959095

90969096
SmallString<64> TyStr;
90979097
llvm::raw_svector_ostream Out(TyStr);
90989098
CGM.getCXXABI().getMangleContext().mangleCanonicalTypeName(Ty, Out);
90999099
std::string Name = getName({"omp_mapper", TyStr, D->getName()});
91009100

9101-
auto *NewFn = OMPBuilder.emitUserDefinedMapper(PrivatizeAndGenMapInfoCB,
9102-
ElemTy, Name, CustomMapperCB);
9101+
llvm::Function *NewFn = cantFail(OMPBuilder.emitUserDefinedMapper(
9102+
PrivatizeAndGenMapInfoCB, ElemTy, Name, CustomMapperCB));
91039103
UDMMap.try_emplace(D, NewFn);
91049104
if (CGF)
91059105
FunctionUDMMap[CGF->CurFn].push_back(D);
@@ -10073,7 +10073,7 @@ void CGOpenMPRuntime::emitTargetDataCalls(
1007310073
};
1007410074

1007510075
auto CustomMapperCB = [&](unsigned int I) {
10076-
llvm::Value *MFunc = nullptr;
10076+
llvm::Function *MFunc = nullptr;
1007710077
if (CombinedInfo.Mappers[I]) {
1007810078
Info.HasMapper = true;
1007910079
MFunc = CGF.CGM.getOpenMPRuntime().getOrCreateUserDefinedMapperFunc(
@@ -10093,7 +10093,8 @@ void CGOpenMPRuntime::emitTargetDataCalls(
1009310093
llvm::OpenMPIRBuilder::InsertPointTy AfterIP =
1009410094
cantFail(OMPBuilder.createTargetData(
1009510095
OmpLoc, AllocaIP, CodeGenIP, DeviceID, IfCondVal, Info, GenMapInfoCB,
10096-
/*MapperFunc=*/nullptr, BodyCB, DeviceAddrCB, CustomMapperCB, RTLoc));
10096+
CustomMapperCB,
10097+
/*MapperFunc=*/nullptr, BodyCB, DeviceAddrCB, RTLoc));
1009710098
CGF.Builder.restoreIP(AfterIP);
1009810099
}
1009910100

0 commit comments

Comments
 (0)