From 2dfb68821410a6cc84951bc8c2d5c232fba148b8 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Fri, 16 Dec 2016 23:54:33 +0000 Subject: Allow "line 0" to be the first explicit debug location in a function. Feedback on r289468 from Adrian Prantl. llvm-svn: 290012 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f83a340219d..a8d46c22681 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1063,7 +1063,7 @@ void DwarfDebug::beginInstruction(const MachineInstr *MI) { // We have an explicit location, different from the previous location. // Don't repeat a line-0 record, but otherwise emit the new location. // (The new location might be an explicit line 0, which we do emit.) - if (DL.getLine() == 0 && LastAsmLine == 0) + if (PrevInstLoc && DL.getLine() == 0 && LastAsmLine == 0) return; unsigned Flags = 0; if (DL == PrologEndLoc) { -- cgit v1.2.3