Skip to content

Commit ed1d70f

Browse files
committed
IRGen: Address llvm::PointerType::get(Unqual) deprecations
See llvm/llvm-project#134517.
1 parent f8577a2 commit ed1d70f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/IRGen/GenBuiltin.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,7 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
730730
newval = IGF.Builder.CreatePtrToInt(newval, IGF.IGM.IntPtrTy);
731731
}
732732

733-
pointer = IGF.Builder.CreateBitCast(pointer,
734-
llvm::PointerType::getUnqual(cmp->getType()));
733+
pointer = IGF.Builder.CreateBitCast(pointer, IGM.PtrTy);
735734
llvm::Value *value = IGF.Builder.CreateAtomicCmpXchg(
736735
pointer, cmp, newval, llvm::MaybeAlign(),
737736
successOrdering, failureOrdering,
@@ -799,8 +798,7 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
799798
if (origTy->isPointerTy())
800799
val = IGF.Builder.CreatePtrToInt(val, IGF.IGM.IntPtrTy);
801800

802-
pointer = IGF.Builder.CreateBitCast(pointer,
803-
llvm::PointerType::getUnqual(val->getType()));
801+
pointer = IGF.Builder.CreateBitCast(pointer, IGM.PtrTy);
804802
llvm::Value *value = IGF.Builder.CreateAtomicRMW(
805803
SubOpcode, pointer, val, llvm::MaybeAlign(), ordering,
806804
isSingleThread ? llvm::SyncScope::SingleThread

lib/LLVMPasses/LLVMMergeFunctions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,9 @@ bool SwiftMergeFunctions::replaceDirectCallers(Function *Old, Function *New,
13221322

13231323
auto *FType = FunctionType::get(Old->getFunctionType()->getReturnType(),
13241324
OldParamTypes, false);
1325-
auto *FPtrType = PointerType::get(FType,
1326-
cast<PointerType>(New->getType())->getAddressSpace());
1325+
auto *FPtrType =
1326+
PointerType::get(module->getContext(),
1327+
cast<PointerType>(New->getType())->getAddressSpace());
13271328

13281329
Value *Callee = ConstantExpr::getBitCast(New, FPtrType);
13291330
CallInst *NewCI = Builder.CreateCall(FType, Callee, NewArgs);

0 commit comments

Comments
 (0)