[llvm] r205324 - DebugInfo: Factor out common functionality for rendering debug_loc and debug_loc.dwo location list entries

David Blaikie dblaikie at gmail.com
Tue Apr 1 09:17:41 PDT 2014


Author: dblaikie
Date: Tue Apr  1 11:17:41 2014
New Revision: 205324

URL: http://llvm.org/viewvc/llvm-project?rev=205324&view=rev
Log:
DebugInfo: Factor out common functionality for rendering debug_loc and debug_loc.dwo location list entries

In preparation for refactoring this function into two, one for
debug_loc, one for debug_loc.dwo.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=205324&r1=205323&r2=205324&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Apr  1 11:17:41 2014
@@ -2386,6 +2386,19 @@ void DwarfDebug::emitDebugLocEntry(ByteS
   // FIXME: ^
 }
 
+void DwarfDebug::emitDebugLocEntryLocation(const DebugLocEntry &Entry) {
+  Asm->OutStreamer.AddComment("Loc expr size");
+  MCSymbol *begin = Asm->OutStreamer.getContext().CreateTempSymbol();
+  MCSymbol *end = Asm->OutStreamer.getContext().CreateTempSymbol();
+  Asm->EmitLabelDifference(end, begin, 2);
+  Asm->OutStreamer.EmitLabel(begin);
+  // Emit the entry.
+  APByteStreamer Streamer(*Asm);
+  emitDebugLocEntry(Streamer, Entry);
+  // Close the range.
+  Asm->OutStreamer.EmitLabel(end);
+}
+
 // Emit locations into the debug loc section.
 void DwarfDebug::emitDebugLoc() {
   // Start the dwarf loc section.
@@ -2419,16 +2432,7 @@ void DwarfDebug::emitDebugLoc() {
         Asm->OutStreamer.EmitSymbolValue(Entry.getBeginSym(), Size);
         Asm->OutStreamer.EmitSymbolValue(Entry.getEndSym(), Size);
       }
-      Asm->OutStreamer.AddComment("Loc expr size");
-      MCSymbol *begin = Asm->OutStreamer.getContext().CreateTempSymbol();
-      MCSymbol *end = Asm->OutStreamer.getContext().CreateTempSymbol();
-      Asm->EmitLabelDifference(end, begin, 2);
-      Asm->OutStreamer.EmitLabel(begin);
-      // Emit the entry.
-      APByteStreamer Streamer(*Asm);
-      emitDebugLocEntry(Streamer, Entry);
-      // Close the range.
-      Asm->OutStreamer.EmitLabel(end);
+      emitDebugLocEntryLocation(Entry);
     }
     if (useSplitDwarf())
       Asm->EmitInt8(dwarf::DW_LLE_end_of_list_entry);

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=205324&r1=205323&r2=205324&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Apr  1 11:17:41 2014
@@ -772,6 +772,9 @@ public:
   /// handle an entry that's going to be emitted into the debug loc section.
   void emitDebugLocEntry(ByteStreamer &Streamer, const DebugLocEntry &Entry);
 
+  /// Emit the location for a debug loc entry, including the size header.
+  void emitDebugLocEntryLocation(const DebugLocEntry &Entry);
+
   /// Find the MDNode for the given reference.
   template <typename T> T resolve(DIRef<T> Ref) const {
     return Ref.resolve(TypeIdentifierMap);





More information about the llvm-commits mailing list