Skip to content

Commit 4e532de

Browse files
committed
Assorted fixes since rebase and outside core llvm
1 parent d93cfd8 commit 4e532de

File tree

16 files changed

+97
-84
lines changed

16 files changed

+97
-84
lines changed

clang/lib/CodeGen/CGCUDANV.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ static void replaceManagedVar(llvm::GlobalVariable *Var,
483483
}
484484
if (auto *I = dyn_cast<llvm::Instruction>(U)) {
485485
llvm::Value *OldV = Var;
486-
llvm::Instruction *NewV =
487-
new llvm::LoadInst(Var->getType(), ManagedVar, "ld.managed", false,
488-
llvm::Align(Var->getAlignment()), I);
486+
llvm::Instruction *NewV = new llvm::LoadInst(
487+
Var->getType(), ManagedVar, "ld.managed", false,
488+
llvm::Align(Var->getAlignment()), I->getIterator());
489489
WorkItem.pop_back();
490490
// Replace constant expressions directly or indirectly using the managed
491491
// variable with instructions.

clang/lib/CodeGen/CGCall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5033,8 +5033,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
50335033
llvm::AllocaInst *AI;
50345034
if (IP) {
50355035
IP = IP->getNextNode();
5036-
AI = new llvm::AllocaInst(ArgStruct, DL.getAllocaAddrSpace(),
5037-
"argmem", IP);
5036+
AI = new llvm::AllocaInst(ArgStruct, DL.getAllocaAddrSpace(), "argmem",
5037+
IP->getIterator());
50385038
} else {
50395039
AI = CreateTempAlloca(ArgStruct, "argmem");
50405040
}

clang/lib/CodeGen/CGCleanup.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,16 @@ void EHScopeStack::Cleanup::anchor() {}
323323

324324
static void createStoreInstBefore(llvm::Value *value, Address addr,
325325
llvm::Instruction *beforeInst) {
326-
auto store = new llvm::StoreInst(value, addr.getPointer(), beforeInst);
326+
auto store =
327+
new llvm::StoreInst(value, addr.getPointer(), beforeInst->getIterator());
327328
store->setAlignment(addr.getAlignment().getAsAlign());
328329
}
329330

330331
static llvm::LoadInst *createLoadInstBefore(Address addr, const Twine &name,
331332
llvm::Instruction *beforeInst) {
332333
return new llvm::LoadInst(addr.getElementType(), addr.getPointer(), name,
333334
false, addr.getAlignment().getAsAlign(),
334-
beforeInst);
335+
beforeInst->getIterator());
335336
}
336337

337338
/// All the branch fixups on the EH stack have propagated out past the
@@ -639,7 +640,8 @@ static void destroyOptimisticNormalEntry(CodeGenFunction &CGF,
639640
llvm::SwitchInst *si = cast<llvm::SwitchInst>(use.getUser());
640641
if (si->getNumCases() == 1 && si->getDefaultDest() == unreachableBB) {
641642
// Replace the switch with a branch.
642-
llvm::BranchInst::Create(si->case_begin()->getCaseSuccessor(), si);
643+
llvm::BranchInst::Create(si->case_begin()->getCaseSuccessor(),
644+
si->getIterator());
643645

644646
// The switch operand is a load from the cleanup-dest alloca.
645647
llvm::LoadInst *condition = cast<llvm::LoadInst>(si->getCondition());

clang/lib/CodeGen/CGCoroutine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,8 +867,8 @@ void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
867867
EmitStmt(S.getPromiseDeclStmt());
868868

869869
Address PromiseAddr = GetAddrOfLocalVar(S.getPromiseDecl());
870-
auto *PromiseAddrVoidPtr =
871-
new llvm::BitCastInst(PromiseAddr.getPointer(), VoidPtrTy, "", CoroId);
870+
auto *PromiseAddrVoidPtr = new llvm::BitCastInst(
871+
PromiseAddr.getPointer(), VoidPtrTy, "", CoroId->getIterator());
872872
// Update CoroId to refer to the promise. We could not do it earlier because
873873
// promise local variable was not emitted yet.
874874
CoroId->setArgOperand(1, PromiseAddrVoidPtr);

clang/lib/CodeGen/CGExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,
113113
if (ArraySize)
114114
return Builder.CreateAlloca(Ty, ArraySize, Name);
115115
return new llvm::AllocaInst(Ty, CGM.getDataLayout().getAllocaAddrSpace(),
116-
ArraySize, Name, AllocaInsertPt);
116+
ArraySize, Name, AllocaInsertPt->getIterator());
117117
}
118118

119119
/// CreateDefaultAlignTempAlloca - This creates an alloca with the

clang/lib/CodeGen/CGObjC.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2398,7 +2398,8 @@ static llvm::Value *emitOptimizedARCReturnCall(llvm::Value *value,
23982398
llvm::OperandBundleDef OB("clang.arc.attachedcall", bundleArgs);
23992399
auto *oldCall = cast<llvm::CallBase>(value);
24002400
llvm::CallBase *newCall = llvm::CallBase::addOperandBundle(
2401-
oldCall, llvm::LLVMContext::OB_clang_arc_attachedcall, OB, oldCall);
2401+
oldCall, llvm::LLVMContext::OB_clang_arc_attachedcall, OB,
2402+
oldCall->getIterator());
24022403
newCall->copyMetadata(*oldCall);
24032404
oldCall->replaceAllUsesWith(newCall);
24042405
oldCall->eraseFromParent();

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,8 @@ class CodeGenFunction : public CodeGenTypeCache {
12461246
void setBeforeOutermostConditional(llvm::Value *value, Address addr) {
12471247
assert(isInConditionalBranch());
12481248
llvm::BasicBlock *block = OutermostConditional->getStartingBlock();
1249-
auto store = new llvm::StoreInst(value, addr.getPointer(), &block->back());
1249+
auto store = new llvm::StoreInst(value, addr.getPointer(),
1250+
block->back().getIterator());
12501251
store->setAlignment(addr.getAlignment().getAsAlign());
12511252
}
12521253

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5712,13 +5712,13 @@ static void replaceUsesOfNonProtoConstant(llvm::Constant *old,
57125712

57135713
llvm::CallBase *newCall;
57145714
if (isa<llvm::CallInst>(callSite)) {
5715-
newCall =
5716-
llvm::CallInst::Create(newFn, newArgs, newBundles, "", callSite);
5715+
newCall = llvm::CallInst::Create(newFn, newArgs, newBundles, "",
5716+
callSite->getIterator());
57175717
} else {
57185718
auto *oldInvoke = cast<llvm::InvokeInst>(callSite);
5719-
newCall = llvm::InvokeInst::Create(newFn, oldInvoke->getNormalDest(),
5720-
oldInvoke->getUnwindDest(), newArgs,
5721-
newBundles, "", callSite);
5719+
newCall = llvm::InvokeInst::Create(
5720+
newFn, oldInvoke->getNormalDest(), oldInvoke->getUnwindDest(),
5721+
newArgs, newBundles, "", callSite->getIterator());
57225722
}
57235723
newArgs.clear(); // for the next iteration
57245724

llvm/examples/IRTransforms/SimplifyCFG.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static bool eliminateCondBranches_v1(Function &F) {
158158
// Replace the conditional branch with an unconditional one, by creating
159159
// a new unconditional branch to the selected successor and removing the
160160
// conditional one.
161-
BranchInst::Create(BI->getSuccessor(CI->isZero()), BI);
161+
BranchInst::Create(BI->getSuccessor(CI->isZero()), BI->getIterator());
162162
BI->eraseFromParent();
163163
Changed = true;
164164
}
@@ -195,7 +195,7 @@ static bool eliminateCondBranches_v2(Function &F, DominatorTree &DT) {
195195
// a new unconditional branch to the selected successor and removing the
196196
// conditional one.
197197
BranchInst *NewBranch =
198-
BranchInst::Create(BI->getSuccessor(CI->isZero()), BI);
198+
BranchInst::Create(BI->getSuccessor(CI->isZero()), BI->getIterator());
199199
BI->eraseFromParent();
200200

201201
// Delete the edge between BB and RemovedSucc in the DominatorTree, iff
@@ -242,7 +242,8 @@ static bool eliminateCondBranches_v3(Function &F, DominatorTree &DT) {
242242
// a new unconditional branch to the selected successor and removing the
243243
// conditional one.
244244

245-
BranchInst *NewBranch = BranchInst::Create(TakenSucc, BB.getTerminator());
245+
BranchInst *NewBranch =
246+
BranchInst::Create(TakenSucc, BB.getTerminator()->getIterator());
246247
BB.getTerminator()->eraseFromParent();
247248

248249
// Delete the edge between BB and RemovedSucc in the DominatorTree, iff

llvm/include/llvm/IR/InstrTypes.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,19 +1536,10 @@ class CallBase : public Instruction {
15361536
OperandBundleDef OB,
15371537
Instruction *InsertPt = nullptr);
15381538

1539-
/// Create a clone of \p CB with operand bundle \p OB added.
1540-
static CallBase *addOperandBundle(CallBase *CB, uint32_t ID,
1541-
OperandBundleDef OB,
1542-
BasicBlock::iterator InsertPt);
1543-
15441539
/// Create a clone of \p CB with operand bundle \p ID removed.
15451540
static CallBase *removeOperandBundle(CallBase *CB, uint32_t ID,
15461541
Instruction *InsertPt = nullptr);
15471542

1548-
/// Create a clone of \p CB with operand bundle \p ID removed.
1549-
static CallBase *removeOperandBundle(CallBase *CB, uint32_t ID,
1550-
BasicBlock::iterator InsertPt);
1551-
15521543
static bool classof(const Instruction *I) {
15531544
return I->getOpcode() == Instruction::Call ||
15541545
I->getOpcode() == Instruction::Invoke ||

llvm/lib/FuzzMutate/IRMutator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ void InsertFunctionStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) {
389389
auto BuilderFunc = [FTy, F, isRetVoid](ArrayRef<Value *> Srcs,
390390
Instruction *Inst) {
391391
StringRef Name = isRetVoid ? nullptr : "C";
392-
CallInst *Call = CallInst::Create(FTy, F, Srcs, Name, Inst);
392+
CallInst *Call = CallInst::Create(FTy, F, Srcs, Name, Inst->getIterator());
393393
// Don't return this call inst if it return void as it can't be sinked.
394394
return isRetVoid ? nullptr : Call;
395395
};
@@ -542,7 +542,8 @@ void InsertPHIStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) {
542542
if (&BB == &BB.getParent()->getEntryBlock())
543543
return;
544544
Type *Ty = IB.randomType();
545-
PHINode *PHI = PHINode::Create(Ty, llvm::pred_size(&BB), "", &BB.front());
545+
PHINode *PHI =
546+
PHINode::Create(Ty, llvm::pred_size(&BB), "", BB.getFirstInsertionPt());
546547

547548
// Use a map to make sure the same incoming basic block has the same value.
548549
DenseMap<BasicBlock *, Value *> IncomingValues;

llvm/lib/FuzzMutate/Operations.cpp

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ void llvm::describeFuzzerVectorOps(std::vector<fuzzerop::OpDescriptor> &Ops) {
9999

100100
OpDescriptor llvm::fuzzerop::selectDescriptor(unsigned Weight) {
101101
auto buildOp = [](ArrayRef<Value *> Srcs, Instruction *Inst) {
102-
return SelectInst::Create(Srcs[0], Srcs[1], Srcs[2], "S", Inst);
102+
return SelectInst::Create(Srcs[0], Srcs[1], Srcs[2], "S",
103+
Inst->getIterator());
103104
};
104105
return {Weight,
105106
{boolOrVecBoolType(), matchFirstLengthWAnyType(), matchSecondType()},
@@ -108,15 +109,17 @@ OpDescriptor llvm::fuzzerop::selectDescriptor(unsigned Weight) {
108109

109110
OpDescriptor llvm::fuzzerop::fnegDescriptor(unsigned Weight) {
110111
auto buildOp = [](ArrayRef<Value *> Srcs, Instruction *Inst) {
111-
return UnaryOperator::Create(Instruction::FNeg, Srcs[0], "F", Inst);
112+
return UnaryOperator::Create(Instruction::FNeg, Srcs[0], "F",
113+
Inst->getIterator());
112114
};
113115
return {Weight, {anyFloatOrVecFloatType()}, buildOp};
114116
}
115117

116118
OpDescriptor llvm::fuzzerop::binOpDescriptor(unsigned Weight,
117119
Instruction::BinaryOps Op) {
118120
auto buildOp = [Op](ArrayRef<Value *> Srcs, Instruction *Inst) {
119-
return BinaryOperator::Create(Op, Srcs[0], Srcs[1], "B", Inst);
121+
return BinaryOperator::Create(Op, Srcs[0], Srcs[1], "B",
122+
Inst->getIterator());
120123
};
121124
switch (Op) {
122125
case Instruction::Add:
@@ -149,7 +152,8 @@ OpDescriptor llvm::fuzzerop::cmpOpDescriptor(unsigned Weight,
149152
Instruction::OtherOps CmpOp,
150153
CmpInst::Predicate Pred) {
151154
auto buildOp = [CmpOp, Pred](ArrayRef<Value *> Srcs, Instruction *Inst) {
152-
return CmpInst::Create(CmpOp, Pred, Srcs[0], Srcs[1], "C", Inst);
155+
return CmpInst::Create(CmpOp, Pred, Srcs[0], Srcs[1], "C",
156+
Inst->getIterator());
153157
};
154158

155159
switch (CmpOp) {
@@ -174,7 +178,8 @@ OpDescriptor llvm::fuzzerop::splitBlockDescriptor(unsigned Weight) {
174178
// Loop back on this block by replacing the unconditional forward branch
175179
// with a conditional with a backedge.
176180
if (Block != &Block->getParent()->getEntryBlock()) {
177-
BranchInst::Create(Block, Next, Srcs[0], Block->getTerminator());
181+
BranchInst::Create(Block, Next, Srcs[0],
182+
Block->getTerminator()->getIterator());
178183
Block->getTerminator()->eraseFromParent();
179184

180185
// We need values for each phi in the block. Since there isn't a good way
@@ -198,7 +203,8 @@ OpDescriptor llvm::fuzzerop::gepDescriptor(unsigned Weight) {
198203
// generating a random value and picking its type.
199204
Type *Ty = Srcs[1]->getType();
200205
auto Indices = ArrayRef(Srcs).drop_front(2);
201-
return GetElementPtrInst::Create(Ty, Srcs[0], Indices, "G", Inst);
206+
return GetElementPtrInst::Create(Ty, Srcs[0], Indices, "G",
207+
Inst->getIterator());
202208
};
203209
// TODO: Handle aggregates and vectors
204210
// TODO: Support multiple indices.
@@ -242,7 +248,7 @@ OpDescriptor llvm::fuzzerop::extractValueDescriptor(unsigned Weight) {
242248
auto buildExtract = [](ArrayRef<Value *> Srcs, Instruction *Inst) {
243249
// TODO: It's pretty inefficient to shuffle this all through constants.
244250
unsigned Idx = cast<ConstantInt>(Srcs[1])->getZExtValue();
245-
return ExtractValueInst::Create(Srcs[0], {Idx}, "E", Inst);
251+
return ExtractValueInst::Create(Srcs[0], {Idx}, "E", Inst->getIterator());
246252
};
247253
// TODO: Should we handle multiple indices?
248254
return {Weight, {anyAggregateType(), validExtractValueIndex()}, buildExtract};
@@ -301,7 +307,8 @@ OpDescriptor llvm::fuzzerop::insertValueDescriptor(unsigned Weight) {
301307
auto buildInsert = [](ArrayRef<Value *> Srcs, Instruction *Inst) {
302308
// TODO: It's pretty inefficient to shuffle this all through constants.
303309
unsigned Idx = cast<ConstantInt>(Srcs[2])->getZExtValue();
304-
return InsertValueInst::Create(Srcs[0], Srcs[1], {Idx}, "I", Inst);
310+
return InsertValueInst::Create(Srcs[0], Srcs[1], {Idx}, "I",
311+
Inst->getIterator());
305312
};
306313
return {
307314
Weight,
@@ -311,15 +318,17 @@ OpDescriptor llvm::fuzzerop::insertValueDescriptor(unsigned Weight) {
311318

312319
OpDescriptor llvm::fuzzerop::extractElementDescriptor(unsigned Weight) {
313320
auto buildExtract = [](ArrayRef<Value *> Srcs, Instruction *Inst) {
314-
return ExtractElementInst::Create(Srcs[0], Srcs[1], "E", Inst);
321+
return ExtractElementInst::Create(Srcs[0], Srcs[1], "E",
322+
Inst->getIterator());
315323
};
316324
// TODO: Try to avoid undefined accesses.
317325
return {Weight, {anyVectorType(), anyIntType()}, buildExtract};
318326
}
319327

320328
OpDescriptor llvm::fuzzerop::insertElementDescriptor(unsigned Weight) {
321329
auto buildInsert = [](ArrayRef<Value *> Srcs, Instruction *Inst) {
322-
return InsertElementInst::Create(Srcs[0], Srcs[1], Srcs[2], "I", Inst);
330+
return InsertElementInst::Create(Srcs[0], Srcs[1], Srcs[2], "I",
331+
Inst->getIterator());
323332
};
324333
// TODO: Try to avoid undefined accesses.
325334
return {Weight,
@@ -344,7 +353,8 @@ static SourcePred validShuffleVectorIndex() {
344353

345354
OpDescriptor llvm::fuzzerop::shuffleVectorDescriptor(unsigned Weight) {
346355
auto buildShuffle = [](ArrayRef<Value *> Srcs, Instruction *Inst) {
347-
return new ShuffleVectorInst(Srcs[0], Srcs[1], Srcs[2], "S", Inst);
356+
return new ShuffleVectorInst(Srcs[0], Srcs[1], Srcs[2], "S",
357+
Inst->getIterator());
348358
};
349359
return {Weight,
350360
{anyVectorType(), matchFirstType(), validShuffleVectorIndex()},

llvm/lib/FuzzMutate/RandomIRBuilder.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ AllocaInst *RandomIRBuilder::createStackMemory(Function *F, Type *Ty,
6969
BasicBlock *EntryBB = &F->getEntryBlock();
7070
DataLayout DL(F->getParent());
7171
AllocaInst *Alloca = new AllocaInst(Ty, DL.getAllocaAddrSpace(), "A",
72-
&*EntryBB->getFirstInsertionPt());
72+
EntryBB->getFirstInsertionPt());
7373
if (Init)
74-
new StoreInst(Init, Alloca, Alloca->getNextNode());
74+
new StoreInst(Init, Alloca, Alloca->getNextNode()->getIterator());
7575
return Alloca;
7676
}
7777

@@ -165,7 +165,7 @@ Value *RandomIRBuilder::findOrCreateSource(BasicBlock &BB,
165165
Type *Ty = GV->getValueType();
166166
LoadInst *LoadGV = nullptr;
167167
if (BB.getTerminator()) {
168-
LoadGV = new LoadInst(Ty, GV, "LGV", &*BB.getFirstInsertionPt());
168+
LoadGV = new LoadInst(Ty, GV, "LGV", BB.getFirstInsertionPt());
169169
} else {
170170
LoadGV = new LoadInst(Ty, GV, "LGV", &BB);
171171
}
@@ -213,7 +213,7 @@ Value *RandomIRBuilder::newSource(BasicBlock &BB, ArrayRef<Instruction *> Insts,
213213
}
214214
// Pick the type independently.
215215
Type *AccessTy = RS.getSelection()->getType();
216-
auto *NewLoad = new LoadInst(AccessTy, Ptr, "L", &*IP);
216+
auto *NewLoad = new LoadInst(AccessTy, Ptr, "L", IP);
217217

218218
// Only sample this load if it really matches the descriptor
219219
if (Pred.matches(Srcs, NewLoad))
@@ -231,7 +231,8 @@ Value *RandomIRBuilder::newSource(BasicBlock &BB, ArrayRef<Instruction *> Insts,
231231
Function *F = BB.getParent();
232232
AllocaInst *Alloca = createStackMemory(F, Ty, newSrc);
233233
if (BB.getTerminator()) {
234-
newSrc = new LoadInst(Ty, Alloca, /*ArrLen,*/ "L", BB.getTerminator());
234+
newSrc = new LoadInst(Ty, Alloca, /*ArrLen,*/ "L",
235+
BB.getTerminator()->getIterator());
235236
} else {
236237
newSrc = new LoadInst(Ty, Alloca, /*ArrLen,*/ "L", &BB);
237238
}
@@ -325,7 +326,7 @@ Instruction *RandomIRBuilder::connectToSink(BasicBlock &BB,
325326
for (BasicBlock *Dom : Dominators) {
326327
for (Instruction &I : *Dom) {
327328
if (isa<PointerType>(I.getType()))
328-
return new StoreInst(V, &I, Insts.back());
329+
return new StoreInst(V, &I, Insts.back()->getIterator());
329330
}
330331
}
331332
break;
@@ -351,7 +352,7 @@ Instruction *RandomIRBuilder::connectToSink(BasicBlock &BB,
351352
Module *M = BB.getParent()->getParent();
352353
auto [GV, DidCreate] =
353354
findOrCreateGlobalVariable(M, {}, fuzzerop::onlyType(V->getType()));
354-
return new StoreInst(V, GV, Insts.back());
355+
return new StoreInst(V, GV, Insts.back()->getIterator());
355356
}
356357
case EndOfValueSink:
357358
default:
@@ -373,7 +374,7 @@ Instruction *RandomIRBuilder::newSink(BasicBlock &BB,
373374
}
374375
}
375376

376-
return new StoreInst(V, Ptr, Insts.back());
377+
return new StoreInst(V, Ptr, Insts.back()->getIterator());
377378
}
378379

379380
Value *RandomIRBuilder::findPointer(BasicBlock &BB,

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,8 @@ class RuntimeCallInserter {
690690
if (EHPad && EHPad->isEHPad()) {
691691
// Replace CI with a clone with an added funclet OperandBundle
692692
OperandBundleDef OB("funclet", EHPad);
693-
auto *NewCall =
694-
CallBase::addOperandBundle(CI, LLVMContext::OB_funclet, OB, CI);
693+
auto *NewCall = CallBase::addOperandBundle(CI, LLVMContext::OB_funclet,
694+
OB, CI->getIterator());
695695
NewCall->copyMetadata(*CI);
696696
CI->replaceAllUsesWith(NewCall);
697697
CI->eraseFromParent();

llvm/tools/llvm-reduce/deltas/ReduceOperandBundles.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ static void maybeRewriteCallWithDifferentBundles(
8888
});
8989

9090
// Finally actually replace the bundles on the call.
91-
CallBase *NewCall = CallBase::Create(OrigCall, NewBundles, OrigCall);
91+
CallBase *NewCall =
92+
CallBase::Create(OrigCall, NewBundles, OrigCall->getIterator());
9293
OrigCall->replaceAllUsesWith(NewCall);
9394
OrigCall->eraseFromParent();
9495
}

0 commit comments

Comments
 (0)