Skip to content

Commit d965716

Browse files
committed
merge main into amd-staging
2 parents 02518b8 + c8cf393 commit d965716

File tree

67 files changed

+1337
-417
lines changed

Some content is hidden

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

67 files changed

+1337
-417
lines changed

clang/lib/AST/ASTConcept.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void ConstraintSatisfaction::Profile(llvm::FoldingSetNodeID &ID,
8686
ID.AddPointer(ConstraintOwner);
8787
ID.AddInteger(TemplateArgs.size());
8888
for (auto &Arg : TemplateArgs)
89-
Arg.Profile(ID, C);
89+
C.getCanonicalTemplateArgument(Arg).Profile(ID, C);
9090
}
9191

9292
ConceptReference *

clang/lib/AST/ByteCode/Program.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ UnsignedOrNone Program::createGlobal(const ValueDecl *VD, const Expr *Init) {
226226
Globals[PIdx] = NewGlobal;
227227
// All pointers pointing to the previous extern decl now point to the
228228
// new decl.
229-
RedeclBlock->movePointersTo(NewGlobal->block());
229+
// A previous iteration might've already fixed up the pointers for this
230+
// global.
231+
if (RedeclBlock != NewGlobal->block())
232+
RedeclBlock->movePointersTo(NewGlobal->block());
230233
}
231234
}
232235
PIdx = *Idx;

clang/lib/CodeGen/CGAtomic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ namespace {
8686
llvm::Value *StoragePtr = CGF.Builder.CreateConstGEP1_64(
8787
CGF.Int8Ty, BitFieldPtr, OffsetInChars.getQuantity());
8888
StoragePtr = CGF.Builder.CreateAddrSpaceCast(
89-
StoragePtr, CGF.UnqualPtrTy, "atomic_bitfield_base");
89+
StoragePtr, CGF.DefaultPtrTy, "atomic_bitfield_base");
9090
BFI = OrigBFI;
9191
BFI.Offset = Offset;
9292
BFI.StorageSize = AtomicSizeInBits;

clang/lib/CodeGen/CGBlocks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr *E,
12071207
} else {
12081208
// Bitcast the block literal to a generic block literal.
12091209
BlockPtr =
1210-
Builder.CreatePointerCast(BlockPtr, UnqualPtrTy, "block.literal");
1210+
Builder.CreatePointerCast(BlockPtr, DefaultPtrTy, "block.literal");
12111211
// Get pointer to the block invoke function
12121212
FuncPtr = Builder.CreateStructGEP(GenBlockTy, BlockPtr, 3);
12131213

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1673,7 +1673,7 @@ static llvm::Value *EmitX86BitTestIntrinsic(CodeGenFunction &CGF,
16731673
CGF.getLLVMContext(),
16741674
CGF.getContext().getTypeSize(E->getArg(1)->getType()));
16751675
llvm::FunctionType *FTy =
1676-
llvm::FunctionType::get(CGF.Int8Ty, {CGF.UnqualPtrTy, IntType}, false);
1676+
llvm::FunctionType::get(CGF.Int8Ty, {CGF.DefaultPtrTy, IntType}, false);
16771677

16781678
llvm::InlineAsm *IA =
16791679
llvm::InlineAsm::get(FTy, Asm, Constraints, /*hasSideEffects=*/true);

clang/lib/CodeGen/CGCUDANV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ CGNVCUDARuntime::CGNVCUDARuntime(CodeGenModule &CGM)
230230
IntTy = CGM.IntTy;
231231
SizeTy = CGM.SizeTy;
232232
VoidTy = CGM.VoidTy;
233-
PtrTy = CGM.UnqualPtrTy;
233+
PtrTy = CGM.DefaultPtrTy;
234234

235235
if (CGM.getLangOpts().OffloadViaLLVM)
236236
Prefix = "llvm";

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ LValue CodeGenFunction::EmitUnsupportedLValue(const Expr *E,
17561756
const char *Name) {
17571757
ErrorUnsupported(E, Name);
17581758
llvm::Type *ElTy = ConvertType(E->getType());
1759-
llvm::Type *Ty = UnqualPtrTy;
1759+
llvm::Type *Ty = DefaultPtrTy;
17601760
return MakeAddrLValue(
17611761
Address(llvm::UndefValue::get(Ty), ElTy, CharUnits::One()), E->getType());
17621762
}
@@ -4270,7 +4270,7 @@ void CodeGenFunction::EmitCfiCheckFail() {
42704270
llvm::StructType::get(Int8Ty, SourceLocationTy, VoidPtrTy);
42714271

42724272
llvm::Value *V = Builder.CreateConstGEP2_32(
4273-
CfiCheckFailDataTy, Builder.CreatePointerCast(Data, UnqualPtrTy), 0, 0);
4273+
CfiCheckFailDataTy, Builder.CreatePointerCast(Data, DefaultPtrTy), 0, 0);
42744274

42754275
Address CheckKindAddr(V, Int8Ty, getIntAlign());
42764276
llvm::Value *CheckKind = Builder.CreateLoad(CheckKindAddr);
@@ -5711,7 +5711,7 @@ std::optional<LValue> HandleConditionalOperatorLValueSimpleCase(
57115711
if (auto *ThrowExpr = dyn_cast<CXXThrowExpr>(Live->IgnoreParens())) {
57125712
CGF.EmitCXXThrowExpr(ThrowExpr);
57135713
llvm::Type *ElemTy = CGF.ConvertType(Dead->getType());
5714-
llvm::Type *Ty = CGF.UnqualPtrTy;
5714+
llvm::Type *Ty = CGF.DefaultPtrTy;
57155715
return CGF.MakeAddrLValue(
57165716
Address(llvm::UndefValue::get(Ty), ElemTy, CharUnits::One()),
57175717
Dead->getType());

clang/lib/CodeGen/CGObjCMac.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,39 +338,39 @@ class ObjCCommonTypesHelper {
338338
/// GcReadWeakFn -- LLVM objc_read_weak (id *src) function.
339339
llvm::FunctionCallee getGcReadWeakFn() {
340340
// id objc_read_weak (id *)
341-
llvm::Type *args[] = {CGM.UnqualPtrTy};
341+
llvm::Type *args[] = {CGM.DefaultPtrTy};
342342
llvm::FunctionType *FTy = llvm::FunctionType::get(ObjectPtrTy, args, false);
343343
return CGM.CreateRuntimeFunction(FTy, "objc_read_weak");
344344
}
345345

346346
/// GcAssignWeakFn -- LLVM objc_assign_weak function.
347347
llvm::FunctionCallee getGcAssignWeakFn() {
348348
// id objc_assign_weak (id, id *)
349-
llvm::Type *args[] = {ObjectPtrTy, CGM.UnqualPtrTy};
349+
llvm::Type *args[] = {ObjectPtrTy, CGM.DefaultPtrTy};
350350
llvm::FunctionType *FTy = llvm::FunctionType::get(ObjectPtrTy, args, false);
351351
return CGM.CreateRuntimeFunction(FTy, "objc_assign_weak");
352352
}
353353

354354
/// GcAssignGlobalFn -- LLVM objc_assign_global function.
355355
llvm::FunctionCallee getGcAssignGlobalFn() {
356356
// id objc_assign_global(id, id *)
357-
llvm::Type *args[] = {ObjectPtrTy, CGM.UnqualPtrTy};
357+
llvm::Type *args[] = {ObjectPtrTy, CGM.DefaultPtrTy};
358358
llvm::FunctionType *FTy = llvm::FunctionType::get(ObjectPtrTy, args, false);
359359
return CGM.CreateRuntimeFunction(FTy, "objc_assign_global");
360360
}
361361

362362
/// GcAssignThreadLocalFn -- LLVM objc_assign_threadlocal function.
363363
llvm::FunctionCallee getGcAssignThreadLocalFn() {
364364
// id objc_assign_threadlocal(id src, id * dest)
365-
llvm::Type *args[] = {ObjectPtrTy, CGM.UnqualPtrTy};
365+
llvm::Type *args[] = {ObjectPtrTy, CGM.DefaultPtrTy};
366366
llvm::FunctionType *FTy = llvm::FunctionType::get(ObjectPtrTy, args, false);
367367
return CGM.CreateRuntimeFunction(FTy, "objc_assign_threadlocal");
368368
}
369369

370370
/// GcAssignIvarFn -- LLVM objc_assign_ivar function.
371371
llvm::FunctionCallee getGcAssignIvarFn() {
372372
// id objc_assign_ivar(id, id *, ptrdiff_t)
373-
llvm::Type *args[] = {ObjectPtrTy, CGM.UnqualPtrTy, CGM.PtrDiffTy};
373+
llvm::Type *args[] = {ObjectPtrTy, CGM.DefaultPtrTy, CGM.PtrDiffTy};
374374
llvm::FunctionType *FTy = llvm::FunctionType::get(ObjectPtrTy, args, false);
375375
return CGM.CreateRuntimeFunction(FTy, "objc_assign_ivar");
376376
}
@@ -386,7 +386,7 @@ class ObjCCommonTypesHelper {
386386
/// GcAssignStrongCastFn -- LLVM objc_assign_strongCast function.
387387
llvm::FunctionCallee getGcAssignStrongCastFn() {
388388
// id objc_assign_strongCast(id, id *)
389-
llvm::Type *args[] = {ObjectPtrTy, CGM.UnqualPtrTy};
389+
llvm::Type *args[] = {ObjectPtrTy, CGM.DefaultPtrTy};
390390
llvm::FunctionType *FTy = llvm::FunctionType::get(ObjectPtrTy, args, false);
391391
return CGM.CreateRuntimeFunction(FTy, "objc_assign_strongCast");
392392
}
@@ -517,23 +517,23 @@ class ObjCTypesHelper : public ObjCCommonTypesHelper {
517517

518518
/// ExceptionTryEnterFn - LLVM objc_exception_try_enter function.
519519
llvm::FunctionCallee getExceptionTryEnterFn() {
520-
llvm::Type *params[] = {CGM.UnqualPtrTy};
520+
llvm::Type *params[] = {CGM.DefaultPtrTy};
521521
return CGM.CreateRuntimeFunction(
522522
llvm::FunctionType::get(CGM.VoidTy, params, false),
523523
"objc_exception_try_enter");
524524
}
525525

526526
/// ExceptionTryExitFn - LLVM objc_exception_try_exit function.
527527
llvm::FunctionCallee getExceptionTryExitFn() {
528-
llvm::Type *params[] = {CGM.UnqualPtrTy};
528+
llvm::Type *params[] = {CGM.DefaultPtrTy};
529529
return CGM.CreateRuntimeFunction(
530530
llvm::FunctionType::get(CGM.VoidTy, params, false),
531531
"objc_exception_try_exit");
532532
}
533533

534534
/// ExceptionExtractFn - LLVM objc_exception_extract function.
535535
llvm::FunctionCallee getExceptionExtractFn() {
536-
llvm::Type *params[] = {CGM.UnqualPtrTy};
536+
llvm::Type *params[] = {CGM.DefaultPtrTy};
537537
return CGM.CreateRuntimeFunction(
538538
llvm::FunctionType::get(ObjectPtrTy, params, false),
539539
"objc_exception_extract");
@@ -550,7 +550,7 @@ class ObjCTypesHelper : public ObjCCommonTypesHelper {
550550
/// SetJmpFn - LLVM _setjmp function.
551551
llvm::FunctionCallee getSetJmpFn() {
552552
// This is specifically the prototype for x86.
553-
llvm::Type *params[] = {CGM.UnqualPtrTy};
553+
llvm::Type *params[] = {CGM.DefaultPtrTy};
554554
return CGM.CreateRuntimeFunction(
555555
llvm::FunctionType::get(CGM.Int32Ty, params, false), "_setjmp",
556556
llvm::AttributeList::get(CGM.getLLVMContext(),
@@ -1927,7 +1927,7 @@ CGObjCCommonMac::GenerateConstantNSString(const StringLiteral *Literal) {
19271927
// If we don't already have it, construct the type for a constant NSString.
19281928
if (!NSConstantStringType) {
19291929
NSConstantStringType =
1930-
llvm::StructType::create({CGM.UnqualPtrTy, CGM.Int8PtrTy, CGM.IntTy},
1930+
llvm::StructType::create({CGM.DefaultPtrTy, CGM.Int8PtrTy, CGM.IntTy},
19311931
"struct.__builtin_NSString");
19321932
}
19331933

@@ -5959,7 +5959,7 @@ ObjCNonFragileABITypesHelper::ObjCNonFragileABITypesHelper(
59595959
Int8PtrTy, PropertyListPtrTy);
59605960

59615961
// ImpnfABITy - LLVM for id (*)(id, SEL, ...)
5962-
ImpnfABITy = CGM.UnqualPtrTy;
5962+
ImpnfABITy = CGM.DefaultPtrTy;
59635963

59645964
// struct _class_t {
59655965
// struct _class_t *isa;
@@ -6380,7 +6380,7 @@ void CGObjCNonFragileABIMac::GenerateClass(const ObjCImplementationDecl *ID) {
63806380
CGM.getModule(), ObjCTypes.ImpnfABITy, false,
63816381
llvm::GlobalValue::ExternalLinkage, nullptr, "_objc_empty_vtable");
63826382
else
6383-
ObjCEmptyVtableVar = llvm::ConstantPointerNull::get(CGM.UnqualPtrTy);
6383+
ObjCEmptyVtableVar = llvm::ConstantPointerNull::get(CGM.DefaultPtrTy);
63846384
}
63856385

63866386
// FIXME: Is this correct (that meta class size is never computed)?

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,12 +1738,12 @@ llvm::Function *CGOpenMPRuntime::emitThreadPrivateVarDefinition(
17381738
// Copying constructor for the threadprivate variable.
17391739
// Must be NULL - reserved by runtime, but currently it requires that this
17401740
// parameter is always NULL. Otherwise it fires assertion.
1741-
CopyCtor = llvm::Constant::getNullValue(CGM.UnqualPtrTy);
1741+
CopyCtor = llvm::Constant::getNullValue(CGM.DefaultPtrTy);
17421742
if (Ctor == nullptr) {
1743-
Ctor = llvm::Constant::getNullValue(CGM.UnqualPtrTy);
1743+
Ctor = llvm::Constant::getNullValue(CGM.DefaultPtrTy);
17441744
}
17451745
if (Dtor == nullptr) {
1746-
Dtor = llvm::Constant::getNullValue(CGM.UnqualPtrTy);
1746+
Dtor = llvm::Constant::getNullValue(CGM.DefaultPtrTy);
17471747
}
17481748
if (!CGF) {
17491749
auto *InitFunctionTy =

clang/lib/CodeGen/CGPointerAuth.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,10 @@ CodeGenModule::getConstantSignedPointer(llvm::Constant *Pointer, unsigned Key,
426426
llvm::ConstantInt *OtherDiscriminator) {
427427
llvm::Constant *AddressDiscriminator;
428428
if (StorageAddress) {
429-
assert(StorageAddress->getType() == UnqualPtrTy);
429+
assert(StorageAddress->getType() == DefaultPtrTy);
430430
AddressDiscriminator = StorageAddress;
431431
} else {
432-
AddressDiscriminator = llvm::Constant::getNullValue(UnqualPtrTy);
432+
AddressDiscriminator = llvm::Constant::getNullValue(DefaultPtrTy);
433433
}
434434

435435
llvm::ConstantInt *IntegerDiscriminator;

0 commit comments

Comments
 (0)