IRGen: Address llvm::Type::getPointerTo deprecation

See https://github.com/llvm/llvm-project/pull/113331.
This commit is contained in:
Anthony Latsis
2025-07-21 10:43:27 +01:00
parent 2920ea84d1
commit f8577a2731
39 changed files with 485 additions and 802 deletions

View File

@@ -404,7 +404,7 @@ llvm::Value *IRGenFunction::emitLoadOfCompactFunctionPointer(
void IRGenFunction::emitFakeExplosion(const TypeInfo &type,
Explosion &explosion) {
if (!isa<LoadableTypeInfo>(type)) {
explosion.add(llvm::UndefValue::get(type.getStorageType()->getPointerTo()));
explosion.add(llvm::UndefValue::get(IGM.PtrTy));
return;
}
@@ -412,7 +412,7 @@ void IRGenFunction::emitFakeExplosion(const TypeInfo &type,
for (auto &element : schema) {
llvm::Type *elementType;
if (element.isAggregate()) {
elementType = element.getAggregateType()->getPointerTo();
elementType = IGM.PtrTy;
} else {
elementType = element.getScalarType();
}
@@ -465,8 +465,7 @@ Address IRGenFunction::emitAddressAtOffset(llvm::Value *base, Offset offset,
Size objectSize(IGM.DataLayout.getTypeAllocSize(objectTy));
if (byteOffset.isMultipleOf(objectSize)) {
// Cast to T*.
auto objectPtrTy = objectTy->getPointerTo();
base = Builder.CreateBitCast(base, objectPtrTy);
base = Builder.CreateBitCast(base, IGM.PtrTy);
// GEP to the slot, computing the index as a signed number.
auto scaledIndex =
@@ -480,7 +479,7 @@ Address IRGenFunction::emitAddressAtOffset(llvm::Value *base, Offset offset,
// GEP to the slot.
auto offsetValue = offset.getAsValue(*this);
auto slotPtr = emitByteOffsetGEP(base, offsetValue, objectTy);
auto slotPtr = emitByteOffsetGEP(base, offsetValue);
return Address(slotPtr, objectTy, objectAlignment);
}
@@ -878,8 +877,7 @@ void IRGenFunction::emitAwaitAsyncContinuation(
auto &resumeTI = cast<LoadableTypeInfo>(getTypeInfo(resumeTy));
auto resultStorageTy = resumeTI.getStorageType();
auto resultAddr =
Address(Builder.CreateBitOrPointerCast(resultAddrVal,
resultStorageTy->getPointerTo()),
Address(Builder.CreateBitOrPointerCast(resultAddrVal, IGM.PtrTy),
resultStorageTy, resumeTI.getFixedAlignment());
resumeTI.loadAsTake(*this, resultAddr, outDirectResult);
}
@@ -900,8 +898,8 @@ void IRGenFunction::emitResumeAsyncContinuationReturning(
// pointer type.
Address context = emitLoadOfContinuationContext(*this, continuation);
auto destPtrAddr = emitAddrOfContinuationNormalResultPointer(*this, context);
auto destPtr = Builder.CreateBitCast(Builder.CreateLoad(destPtrAddr),
valueTI.getStorageType()->getPointerTo());
auto destPtr =
Builder.CreateBitCast(Builder.CreateLoad(destPtrAddr), IGM.PtrTy);
Address destAddr = valueTI.getAddressForPointer(destPtr);
valueTI.initializeWithTake(*this, destAddr, srcAddr, valueTy,