AsmPrinter: Don't emit empty .debug_loc entries
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 21 Jun 2015 16:54:56 +0000 (16:54 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 21 Jun 2015 16:54:56 +0000 (16:54 +0000)
commitf1c527b5c18a615669a3d71adb7fbd072b94da4d
tree15b1d3fb760e8db0d9d84fe5aa8bf04e298cbdc3
parent01a8dc8ca61974beb5283f5e75a85644ab84b40d
AsmPrinter: Don't emit empty .debug_loc entries

If we don't know how to represent a .debug_loc entry, skip the entry
entirely rather than emitting an empty one.  Similarly, if a .debug_loc
list has no entries, don't create the list.

We still want to create the variables, just in an optimized-out form
that doesn't have a DW_AT_location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240244 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/CMakeLists.txt
lib/CodeGen/AsmPrinter/DebugLocEntry.h
lib/CodeGen/AsmPrinter/DebugLocStream.cpp [new file with mode: 0644]
lib/CodeGen/AsmPrinter/DebugLocStream.h
lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/DebugInfo/X86/debug-loc-empty-entries.ll [new file with mode: 0644]