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.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h') diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h index b8bbcec..cd02c44 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h +++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.h @@ -38,10 +38,12 @@ protected: MachineModuleInfo *MMI; /// Previous instruction's location information. This is used to - /// determine label location to indicate scope boundries in dwarf - /// debug info. + /// determine label location to indicate scope boundaries in debug info. + /// We track the previous instruction's source location (if not line 0), + /// whether it was a label, and its parent BB. DebugLoc PrevInstLoc; MCSymbol *PrevLabel = nullptr; + const MachineBasicBlock *PrevInstBB = nullptr; /// This location indicates end of function prologue and beginning of /// function body. -- cgit v1.1