From 47f615eae51a51cae58a8c9c0422c95ada7f5204 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Tue, 17 Dec 2013 23:32:35 +0000 Subject: DebugInfo: Introduce new DIValue, DIETypeSignature to encode references to type units via their signatures This simplifies type unit and type unit reference creation as well as setting the stage for inter-type hashing across type unit boundaries. llvm-svn: 197539 --- llvm/lib/CodeGen/AsmPrinter/DIE.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'llvm/lib/CodeGen/AsmPrinter/DIE.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp index 264d89152cf..e973541ee5b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DIE.cpp @@ -13,6 +13,7 @@ #include "DIE.h" #include "DwarfDebug.h" +#include "DwarfUnit.h" #include "llvm/ADT/Twine.h" #include "llvm/CodeGen/AsmPrinter.h" #include "llvm/IR/DataLayout.h" @@ -403,6 +404,22 @@ void DIEEntry::print(raw_ostream &O) const { } #endif +//===----------------------------------------------------------------------===// +// DIETypeSignature Implementation +//===----------------------------------------------------------------------===// +void DIETypeSignature::EmitValue(AsmPrinter *Asm, dwarf::Form Form) const { + assert(Form == dwarf::DW_FORM_ref_sig8); + Asm->OutStreamer.EmitIntValue(Unit.getTypeSignature(), 8); +} + +#ifndef NDEBUG +void DIETypeSignature::print(raw_ostream &O) const { + O << format("Type Unit: 0x%lx", Unit.getTypeSignature()); +} + +void DIETypeSignature::dump() const { print(dbgs()); } +#endif + //===----------------------------------------------------------------------===// // DIEBlock Implementation //===----------------------------------------------------------------------===// -- cgit v1.2.3