[llvm] [DebugInfo] Handle trailing empty blocks when seeking prologue_end spot (PR #117320)
Jeremy Morse via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 25 09:35:27 PST 2024
================
@@ -2192,14 +2192,42 @@ findPrologueEndLoc(const MachineFunction *MF) {
// better off synthesising an early prologue_end.
auto CurBlock = MF->begin();
auto CurInst = CurBlock->begin();
- while (true) {
+
+ // Find the initial instruction, we're guaranteed one by the caller.
+ while (CurBlock->empty())
+ CurInst = (++CurBlock)->begin();
+
----------------
jmorse wrote:
I suppose so, yeah -- you mean immediately after the loop terminates, yes? (I'll send that up in the patch to demonstrate)
https://github.com/llvm/llvm-project/pull/117320
More information about the llvm-commits
mailing list