OSDN Git Service

Ranges in the .debug_range section need to have begin and end labels,
authorEric Christopher <echristo@gmail.com>
Fri, 20 Dec 2013 04:34:22 +0000 (04:34 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 20 Dec 2013 04:34:22 +0000 (04:34 +0000)
assert that this is so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197780 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 1c6d1a7..a30e8bb 100644 (file)
@@ -2938,14 +2938,12 @@ void DwarfDebug::emitDebugRanges() {
                RE = List.getRanges().end();
            RI != RE; ++RI) {
         const RangeSpan &Range = *RI;
-        // We occasionally have ranges without begin/end labels.
-        // FIXME: Verify and fix.
         const MCSymbol *Begin = Range.getStart();
         const MCSymbol *End = Range.getEnd();
-        Begin ? Asm->OutStreamer.EmitSymbolValue(Begin, Size)
-              : Asm->OutStreamer.EmitIntValue(0, Size);
-        End ? Asm->OutStreamer.EmitSymbolValue(End, Size)
-            : Asm->OutStreamer.EmitIntValue(0, Size);
+        assert(Begin && "Range without a begin symbol?");
+        assert(End && "Range without an end symbol?");
+        Asm->OutStreamer.EmitSymbolValue(Begin, Size);
+        Asm->OutStreamer.EmitSymbolValue(End, Size);
       }
 
       // And terminate the list with two 0 values.
@@ -2960,15 +2958,12 @@ void DwarfDebug::emitDebugRanges() {
       const SmallVectorImpl<RangeSpan> &Ranges = TheCU->getRanges();
       for (uint32_t i = 0, e = Ranges.size(); i != e; ++i) {
         RangeSpan Range = Ranges[i];
-
-        // We occasionally have ranges without begin/end labels.
-        // FIXME: Verify and fix.
         const MCSymbol *Begin = Range.getStart();
         const MCSymbol *End = Range.getEnd();
-        Begin ? Asm->OutStreamer.EmitSymbolValue(Begin, Size)
-              : Asm->OutStreamer.EmitIntValue(0, Size);
-        End ? Asm->OutStreamer.EmitSymbolValue(End, Size)
-            : Asm->OutStreamer.EmitIntValue(0, Size);
+        assert(Begin && "Range without a begin symbol?");
+        assert(End && "Range without an end symbol?");
+        Asm->OutStreamer.EmitSymbolValue(Begin, Size);
+        Asm->OutStreamer.EmitSymbolValue(End, Size);
       }
       // And terminate the list with two 0 values.
       Asm->OutStreamer.EmitIntValue(0, Size);