diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-06 00:21:25 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-06 00:21:25 +0000 |
commit | fb0412f03992945d96a35191165764a2a9ea9751 (patch) | |
tree | 6e33c70e00ced6278e172aaeb7f5f8ab6f1be217 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 3b652621a990cef7b8e291beb3f5446ef4f5bfdc (diff) | |
download | bcm5719-llvm-fb0412f03992945d96a35191165764a2a9ea9751.tar.gz bcm5719-llvm-fb0412f03992945d96a35191165764a2a9ea9751.zip |
DebugInfo: Assert that any CU for which debug_loc lists are emitted, has at least one range.
This was coming in weird debug info that had variables (and hence
debug_locs) but was in GMLT mode (because it was missing the 13th field
of the compile_unit metadata) so no ranges were constructed. We should
always have at least one range for any CU with a debug_loc in it -
because the range should cover the debug_loc.
The assertion just ensures that the "!= 1" range case inside the
subsequent loop doesn't get entered for the case where there are no
ranges at all, which should never reach here in the first place.
llvm-svn: 214939
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index ee23a1c5d22..a0d58c6310c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2199,6 +2199,7 @@ void DwarfDebug::emitDebugLoc() { for (const auto &DebugLoc : DotDebugLocEntries) { Asm->OutStreamer.EmitLabel(DebugLoc.Label); const DwarfCompileUnit *CU = DebugLoc.CU; + assert(!CU->getRanges().empty()); for (const auto &Entry : DebugLoc.List) { // Set up the range. This range is relative to the entry point of the // compile unit. This is a hard coded 0 for low_pc when we're emitting |