Skip to content

Commit b2f6d93

Browse files
committed
Assorted fixes since rebase and outside core llvm
1 parent 5ed60ff commit b2f6d93

File tree

16 files changed

+98
-85
lines changed

16 files changed

+98
-85
lines changed

clang/lib/CodeGen/CGCUDANV.cpp

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

clang/lib/CodeGen/CGCall.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5062,8 +5062,8 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
50625062
llvm::AllocaInst *AI;
50635063
if (IP) {
50645064
IP = IP->getNextNode();
5065-
AI = new llvm::AllocaInst(ArgStruct, DL.getAllocaAddrSpace(),
5066-
"argmem", IP);
5065+
AI = new llvm::AllocaInst(ArgStruct, DL.getAllocaAddrSpace(), "argmem",
5066+
IP->getIterator());
50675067
} else {
50685068
AI = CreateTempAlloca(ArgStruct, "argmem");
50695069
}

clang/lib/CodeGen/CGCleanup.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ void EHScopeStack::Cleanup::anchor() {}
295295
static void createStoreInstBefore(llvm::Value *value, Address addr,
296296
llvm::Instruction *beforeInst,
297297
CodeGenFunction &CGF) {
298-
auto store = new llvm::StoreInst(value, addr.emitRawPointer(CGF), beforeInst);
298+
auto store = new llvm::StoreInst(value, addr.emitRawPointer(CGF),
299+
beforeInst->getIterator());
299300
store->setAlignment(addr.getAlignment().getAsAlign());
300301
}
301302

@@ -304,7 +305,7 @@ static llvm::LoadInst *createLoadInstBefore(Address addr, const Twine &name,
304305
CodeGenFunction &CGF) {
305306
return new llvm::LoadInst(addr.getElementType(), addr.emitRawPointer(CGF),
306307
name, false, addr.getAlignment().getAsAlign(),
307-
beforeInst);
308+
beforeInst->getIterator());
308309
}
309310

310311
/// All the branch fixups on the EH stack have propagated out past the
@@ -612,7 +613,8 @@ static void destroyOptimisticNormalEntry(CodeGenFunction &CGF,
612613
llvm::SwitchInst *si = cast<llvm::SwitchInst>(use.getUser());
613614
if (si->getNumCases() == 1 && si->getDefaultDest() == unreachableBB) {
614615
// Replace the switch with a branch.
615-
llvm::BranchInst::Create(si->case_begin()->getCaseSuccessor(), si);
616+
llvm::BranchInst::Create(si->case_begin()->getCaseSuccessor(),
617+
si->getIterator());
616618

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

clang/lib/CodeGen/CGCoroutine.cpp

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

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

clang/lib/CodeGen/CGExpr.cpp

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

118118
/// 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
@@ -2394,7 +2394,8 @@ static llvm::Value *emitOptimizedARCReturnCall(llvm::Value *value,
23942394
llvm::OperandBundleDef OB("clang.arc.attachedcall", bundleArgs);
23952395
auto *oldCall = cast<llvm::CallBase>(value);
23962396
llvm::CallBase *newCall = llvm::CallBase::addOperandBundle(
2397-
oldCall, llvm::LLVMContext::OB_clang_arc_attachedcall, OB, oldCall);
2397+
oldCall, llvm::LLVMContext::OB_clang_arc_attachedcall, OB,
2398+
oldCall->getIterator());
23982399
newCall->copyMetadata(*oldCall);
23992400
oldCall->replaceAllUsesWith(newCall);
24002401
oldCall->eraseFromParent();

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,8 +1269,8 @@ class CodeGenFunction : public CodeGenTypeCache {
12691269
CodeGenFunction &CGF) {
12701270
assert(isInConditionalBranch());
12711271
llvm::BasicBlock *block = OutermostConditional->getStartingBlock();
1272-
auto store =
1273-
new llvm::StoreInst(value, addr.emitRawPointer(CGF), &block->back());
1272+
auto store = new llvm::StoreInst(value, addr.emitRawPointer(CGF),
1273+
&block->back().getIterator());
12741274
store->setAlignment(addr.getAlignment().getAsAlign());
12751275
}
12761276

clang/lib/CodeGen/CodeGenModule.cpp

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

57485748
llvm::CallBase *newCall;
57495749
if (isa<llvm::CallInst>(callSite)) {
5750-
newCall =
5751-
llvm::CallInst::Create(newFn, newArgs, newBundles, "", callSite);
5750+
newCall = llvm::CallInst::Create(newFn, newArgs, newBundles, "",
5751+
callSite->getIterator());
57525752
} else {
57535753
auto *oldInvoke = cast<llvm::InvokeInst>(callSite);
5754-
newCall = llvm::InvokeInst::Create(newFn, oldInvoke->getNormalDest(),
5755-
oldInvoke->getUnwindDest(), newArgs,
5756-
newBundles, "", callSite);
5754+
newCall = llvm::InvokeInst::Create(
5755+
newFn, oldInvoke->getNormalDest(), oldInvoke->getUnwindDest(),
5756+
newArgs, newBundles, "", callSite->getIterator());
57575757
}
57585758
newArgs.clear(); // for the next iteration
57595759

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
@@ -1542,19 +1542,10 @@ class CallBase : public Instruction {
15421542
OperandBundleDef OB,
15431543
Instruction *InsertPt = nullptr);
15441544

1545-
/// Create a clone of \p CB with operand bundle \p OB added.
1546-
static CallBase *addOperandBundle(CallBase *CB, uint32_t ID,
1547-
OperandBundleDef OB,
1548-
BasicBlock::iterator InsertPt);
1549-
15501545
/// Create a clone of \p CB with operand bundle \p ID removed.
15511546
static CallBase *removeOperandBundle(CallBase *CB, uint32_t ID,
15521547
Instruction *InsertPt = nullptr);
15531548

1554-
/// Create a clone of \p CB with operand bundle \p ID removed.
1555-
static CallBase *removeOperandBundle(CallBase *CB, uint32_t ID,
1556-
BasicBlock::iterator InsertPt);
1557-
15581549
static bool classof(const Instruction *I) {
15591550
return I->getOpcode() == Instruction::Call ||
15601551
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)