llvm-6502/lib/CodeGen/AsmPrinter
David Blaikie 0d9056d766 DebugInfo: Assert that DbgVariables have associated DIEs
This was previously committed in r209680 and reverted in r209683 after
it caused sanitizer builds to crash.

The issue seems to be that the DebugLoc associated with dbg.value IR
intrinsics isn't necessarily accurate. Instead, we duplicate the
DIVariables and add an InlinedAt field to them to record their
location.

We were using this InlinedAt field to compute the LexicalScope for the
variable, but not using it in the abstract DbgVariable construction and
mapping. This resulted in a formal parameter to the current concrete
function, correctly having no InlinedAt information, but incorrectly
having a DebugLoc that described an inlined location within the
function... thus an abstract DbgVariable was created for the variable,
but its DIE was never constructed (since the LexicalScope had no such
variable). This DbgVariable was silently ignored (by testing for a
non-null DIE on the abstract DbgVariable).

So, fix this by using the right scoping information when constructing
abstract DbgVariables.

In the long run, I suspect we want to undo the work that added this
second kind of location tracking and fix the places where the DebugLoc
propagation on the dbg.value intrinsic fails. This will shrink debug
info (by not duplicating DIVariables), make it more efficient (by not
having to construct new DIVariable metadata nodes to try to map back to
a single variable), and benefit all instructions.

But perhaps there are insurmountable issues with DebugLoc quality that
I'm unaware of... I just don't know how we can't /just keep the DebugLoc
from the dbg.declare to the dbg.values and never get this wrong/.

Some history context:

http://llvm.org/viewvc/llvm-project?view=revision&revision=135629
http://llvm.org/viewvc/llvm-project?view=revision&revision=137253

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209984 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-01 03:38:13 +00:00
..
AddressPool.cpp DWARF Type Units: Avoid emitting type units under fission if the type requires an address. 2014-04-26 17:27:38 +00:00
AddressPool.h AddressPool::HasBeenUsed: Add comment explaining the use-case for this flag. 2014-04-28 22:52:50 +00:00
ARMException.cpp Fix ARM EHABI when function has landingpad and nounwind. 2014-05-14 16:38:30 +00:00
AsmPrinter.cpp Delete getAliasedGlobal. 2014-05-16 22:37:03 +00:00
AsmPrinterDwarf.cpp Clarify the doxygen comment for AsmPrinter::EmitDwarfRegOpPiece and add 2014-04-27 18:50:45 +00:00
AsmPrinterHandler.h Remove weak vtables. No functional change. 2013-12-14 12:23:14 +00:00
AsmPrinterInlineAsm.cpp [C++] Use 'nullptr'. 2014-04-24 06:44:33 +00:00
ByteStreamer.h [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-08 06:31:39 +00:00
CMakeLists.txt Move logic for calculating DBG_VALUE history map into separate file/class. 2014-04-30 21:34:11 +00:00
DbgValueHistoryCalculator.cpp Change representation of instruction ranges where variable is accessible. 2014-05-27 23:09:50 +00:00
DbgValueHistoryCalculator.h Change representation of instruction ranges where variable is accessible. 2014-05-27 23:09:50 +00:00
DebugLocEntry.h [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00
DebugLocList.h DebugInfo: Introduce DebugLocList to encapsulate a list of DebugLocEntries and an MC Label to refer to them 2014-04-02 01:43:18 +00:00
DIE.cpp DIEEntry: Refer to the specified DIE via reference rather than pointer. 2014-04-25 19:33:43 +00:00
DIE.h DIE: Document some learnings about why the world isn't perfect. 2014-04-28 22:41:39 +00:00
DIEHash.cpp DIEEntry: Refer to the specified DIE via reference rather than pointer. 2014-04-25 19:33:43 +00:00
DIEHash.h [C++] Use 'nullptr'. 2014-04-24 06:44:33 +00:00
DwarfAccelTable.cpp DwarfAccelTable: Store the string symbol in the accelerator table to avoid duplicate lookup. 2014-04-25 22:21:35 +00:00
DwarfAccelTable.h Remove redundant explicit default initialization of non-trivially constructed member. 2014-04-27 14:47:23 +00:00
DwarfCFIException.cpp Fix MIPS exception personality encoding. 2014-05-30 16:48:56 +00:00
DwarfDebug.cpp DebugInfo: Assert that DbgVariables have associated DIEs 2014-06-01 03:38:13 +00:00
DwarfDebug.h Roll DbgVariable::setMInsn into the constructor. No functional changes. 2014-05-30 21:10:13 +00:00
DwarfException.cpp Convert more loops to range-based equivalents 2014-04-30 22:17:38 +00:00
DwarfException.h [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-08 06:31:39 +00:00
DwarfFile.cpp Encapsulate the DWARF string pool in a separate type. 2014-04-25 21:34:35 +00:00
DwarfFile.h Encapsulate the DWARF string pool in a separate type. 2014-04-25 21:34:35 +00:00
DwarfStringPool.cpp Make helper functions static. 2014-04-27 14:54:59 +00:00
DwarfStringPool.h Encapsulate the DWARF string pool in a separate type. 2014-04-25 21:34:35 +00:00
DwarfUnit.cpp DebugInfo: Assert that DbgVariables have associated DIEs 2014-06-01 03:38:13 +00:00
DwarfUnit.h DebugInfo: Simplify solution to avoid DW_AT_artificial on inlined parameters. 2014-05-27 19:34:32 +00:00
ErlangGCPrinter.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-08 06:31:39 +00:00
LLVMBuild.txt Add proper dependencies to LLVMBuild.txt in llvm/lib. 2013-12-10 05:39:34 +00:00
Makefile
OcamlGCPrinter.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-08 06:31:39 +00:00
Win64Exception.cpp Add back r201608, r201622, r201624 and r201625 2014-02-19 17:23:20 +00:00
WinCodeViewLineTables.cpp Convert more loops to range-based equivalents 2014-04-30 22:17:38 +00:00
WinCodeViewLineTables.h [C++] Use 'nullptr'. 2014-04-28 04:05:08 +00:00