[llvm] [DebugInfo][RemoveDIs] Have getInsertionPtAfterDef return an iterator (PR #73149)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 01:50:04 PST 2023
================
@@ -643,8 +655,10 @@ Value *GuardWideningImpl::freezeAndPush(Value *Orig, Instruction *InsertPt) {
if (Visited.insert(Def).second) {
if (isGuaranteedNotToBePoison(Def, nullptr, InsertPt, &DT))
return true;
- CacheOfFreezes[Def] = new FreezeInst(Def, Def->getName() + ".gw.fr",
- getFreezeInsertPt(Def, DT));
+ BasicBlock::iterator InsertPt = *getFreezeInsertPt(Def, DT);
+ FreezeInst *FI = new FreezeInst(Def, Def->getName() + ".gw.fr");
+ FI->insertBefore(*InsertPt->getParent(), InsertPt);
+ CacheOfFreezes[Def] = FI;
----------------
OCHyams wrote:
It's a shame about the added verbosity. Is there anything we can do about that? (Update/add instruction ctors as we go along, etc).
https://github.com/llvm/llvm-project/pull/73149
More information about the llvm-commits
mailing list