From 10ce1bc8d02738c20a7e6c49f51b28a26d93927f Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Wed, 15 Apr 2020 17:54:39 -0700 Subject: [MachineBasicBlock] Add helpers for skipping debug instructions [1/14] Summary: These helpers are exercised by follow-up commits in this patch series, which is all about removing CodeGen differences with vs. without debug info in the AArch64 backend. Reviewers: fhahn, aprantl, jpaquette, paquette Subscribers: kristof.beyls, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D78260 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 5f46086..57dd8d3 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -1329,8 +1329,8 @@ MachineBasicBlock::findDebugLoc(instr_iterator MBBI) { /// instructions. Return UnknownLoc if there is none. DebugLoc MachineBasicBlock::findPrevDebugLoc(instr_iterator MBBI) { if (MBBI == instr_begin()) return {}; - // Skip debug declarations, we don't want a DebugLoc from them. - MBBI = skipDebugInstructionsBackward(std::prev(MBBI), instr_begin()); + // Skip debug instructions, we don't want a DebugLoc from them. + MBBI = prev_nodbg(MBBI, instr_begin()); if (!MBBI->isDebugInstr()) return MBBI->getDebugLoc(); return {}; } -- cgit v1.1