From 37a13ddb4bb433ddebc64bf51a10f48fe75ac49c Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Wed, 30 Nov 2016 22:49:55 +0000 Subject: Recommit r288212: Emit 'no line' information for interesting 'orphan' instructions. The LLDB tests are now ready for this patch. DWARF specifies that "line 0" really means "no appropriate source location" in the line table. Use this for branch targets and some other cases that have no specified source location, to prevent inheriting unfortunate line numbers from physically preceding instructions (which might be from completely unrelated source). Differential Revision: http://reviews.llvm.org/D24180 llvm-svn: 288283 --- llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp index d30f106a939..5607242a7f1 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -201,8 +201,10 @@ void DebugHandlerBase::endInstruction() { assert(CurMI != nullptr); // Don't create a new label after DBG_VALUE instructions. // They don't generate code. - if (!CurMI->isDebugValue()) + if (!CurMI->isDebugValue()) { PrevLabel = nullptr; + PrevInstBB = CurMI->getParent(); + } DenseMap::iterator I = LabelsAfterInsn.find(CurMI); -- cgit v1.2.3