Two part patch:
First: refactor out the emission of entries into the .debug_loc section
into its own routine.
Second: add a new class ByteStreamer that can be used to either emit
using an AsmPrinter or hash using DIEHash the series of bytes that
would be emitted. Use this in all of the location emission routines
for the .debug_loc section.
No functional change intended outside of a few additional comments
in verbose assembly.
llvm-svn: 203304
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 1373e96..0dadb73 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -31,6 +31,7 @@
namespace llvm {
+class ByteStreamer;
class DwarfUnit;
class DwarfCompileUnit;
class ConstantInt;
@@ -587,6 +588,9 @@
/// \brief Emit visible names into a debug str section.
void emitDebugStr();
+ /// \brief Emit an entry for the debug loc section.
+ void emitDebugLocEntry(ByteStreamer &Streamer, const DotDebugLocEntry &Entry);
+
/// \brief Emit visible names into a debug loc section.
void emitDebugLoc();