diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2023-12-05 18:49:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 18:49:27 +0000 |
commit | 33af16f580b168c99a61db118ef59aaf6dd1488f (patch) | |
tree | 6545873525969e1516620ef0c489f7b5426a4e50 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 7563eb64102c3bee9b0ab581309d170891fa0565 (diff) | |
download | llvm-33af16f580b168c99a61db118ef59aaf6dd1488f.zip llvm-33af16f580b168c99a61db118ef59aaf6dd1488f.tar.gz llvm-33af16f580b168c99a61db118ef59aaf6dd1488f.tar.bz2 |
[DebugInfo][RemoveDIs] Final cleanup for enabling non-instr-debuginfo (#74497)
Some final errors have turned up when doing stage2clang builds:
* We can insert before end(), which won't have an attached DPMarker,
thus we can have a nullptr DPMarker in Instruction::insertBefore. Add a
null check there.
* We need to use the iterator-returning form of getFirstNonPHI to ensure
we don't insert any PHIs behind debug-info at the start of a block.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index dfc78aa..51f39e0 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1295,7 +1295,7 @@ bool llvm::TryToSimplifyUncondBranchFromEmptyBlock(BasicBlock *BB, // the same predecessors BB had. // Copy over any phi, debug or lifetime instruction. BB->getTerminator()->eraseFromParent(); - Succ->splice(Succ->getFirstNonPHI()->getIterator(), BB); + Succ->splice(Succ->getFirstNonPHIIt(), BB); } else { while (PHINode *PN = dyn_cast<PHINode>(&BB->front())) { // We explicitly check for such uses for merging phis. |