From 2de471dca9ce60211dbd1f2b8bd6330e32cdbd56 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Mon, 31 Jul 2017 21:03:08 +0000 Subject: [codeview] Ignore DBG_VALUEs when choosing a BB start source loc When the first instruction of a basic block has no location (consider a LEA materializing the address of an alloca for a call), we want to start the line table for the block with the first valid source location in the block. We need to ignore DBG_VALUE instructions during this scan to get decent line tables. llvm-svn: 309628 --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index c9686cccfdf..38ae15cbd98 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -2157,6 +2157,8 @@ void CodeViewDebug::beginInstruction(const MachineInstr *MI) { DebugLoc DL = MI->getDebugLoc(); if (!DL && MI->getParent() != PrevInstBB) { for (const auto &NextMI : *MI->getParent()) { + if (NextMI.isDebugValue()) + continue; DL = NextMI.getDebugLoc(); if (DL) break; -- cgit v1.2.3