Skip to content

Commit b04d608

Browse files
committed
IRGen: Address llvm::InsertPosition ctor deprecation
See llvm/llvm-project#102608.
1 parent b66a1aa commit b04d608

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5933,9 +5933,8 @@ void IRGenModule::emitExtension(ExtensionDecl *ext) {
59335933
Address IRGenFunction::createAlloca(llvm::Type *type,
59345934
Alignment alignment,
59355935
const llvm::Twine &name) {
5936-
llvm::AllocaInst *alloca =
5937-
new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), name,
5938-
AllocaIP);
5936+
llvm::AllocaInst *alloca = new llvm::AllocaInst(
5937+
type, IGM.DataLayout.getAllocaAddrSpace(), name, AllocaIP->getIterator());
59395938
alloca->setAlignment(llvm::MaybeAlign(alignment.getValue()).valueOrOne());
59405939
return Address(alloca, type, alignment);
59415940
}
@@ -5945,9 +5944,10 @@ Address IRGenFunction::createAlloca(llvm::Type *type,
59455944
llvm::Value *ArraySize,
59465945
Alignment alignment,
59475946
const llvm::Twine &name) {
5948-
llvm::AllocaInst *alloca = new llvm::AllocaInst(
5949-
type, IGM.DataLayout.getAllocaAddrSpace(), ArraySize,
5950-
llvm::MaybeAlign(alignment.getValue()).valueOrOne(), name, AllocaIP);
5947+
llvm::AllocaInst *alloca =
5948+
new llvm::AllocaInst(type, IGM.DataLayout.getAllocaAddrSpace(), ArraySize,
5949+
llvm::MaybeAlign(alignment.getValue()).valueOrOne(),
5950+
name, AllocaIP->getIterator());
59515951
return Address(alloca, type, alignment);
59525952
}
59535953

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3706,10 +3706,11 @@ struct DbgIntrinsicEmitter {
37063706
const llvm::DILocation *DL,
37073707
llvm::Instruction *InsertBefore) {
37083708
if (ForceDbgDeclare == AddrDbgInstrKind::DbgDeclare)
3709-
return DIBuilder.insertDeclare(Addr, VarInfo, Expr, DL, InsertBefore);
3709+
return DIBuilder.insertDeclare(Addr, VarInfo, Expr, DL,
3710+
InsertBefore->getIterator());
37103711
Expr = llvm::DIExpression::append(Expr, llvm::dwarf::DW_OP_deref);
37113712
return DIBuilder.insertDbgValueIntrinsic(Addr, VarInfo, Expr, DL,
3712-
InsertBefore);
3713+
InsertBefore->getIterator());
37133714
}
37143715

37153716
llvm::DbgInstPtr insert(llvm::Value *Addr, llvm::DILocalVariable *VarInfo,

lib/IRGen/IRGenSIL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ class IRGenSILFunction :
823823
if (DVI->getParent() == BB)
824824
IGM.DebugInfo->getBuilder().insertDbgValueIntrinsic(
825825
DVI->getValue(), DVI->getVariable(), DVI->getExpression(),
826-
DVI->getDebugLoc(), &*CurBB->getFirstInsertionPt());
826+
DVI->getDebugLoc(), CurBB->getFirstInsertionPt());
827827
}
828828
}
829829
}

lib/LLVMPasses/LLVMMergeFunctions.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,9 @@ void SwiftMergeFunctions::replaceCallWithAddedPtrAuth(CallInst *origCall,
10461046
copiedArgs.push_back(op);
10471047
}
10481048

1049-
auto *newCall = CallInst::Create(origCall->getFunctionType(),
1050-
newCallee, copiedArgs, bundles, origCall->getName(), origCall);
1049+
auto *newCall =
1050+
CallInst::Create(origCall->getFunctionType(), newCallee, copiedArgs,
1051+
bundles, origCall->getName(), origCall->getIterator());
10511052
newCall->setAttributes(origCall->getAttributes());
10521053
newCall->setTailCallKind(origCall->getTailCallKind());
10531054
newCall->setCallingConv(origCall->getCallingConv());

0 commit comments

Comments
 (0)