summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DIE.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-12-17 23:32:35 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-12-17 23:32:35 +0000
commit47f615eae51a51cae58a8c9c0422c95ada7f5204 (patch)
treeb6e419c3d511582207d6f7532642e6b9d3558835 /llvm/lib/CodeGen/AsmPrinter/DIE.h
parentc2e60f52aee022c298b8cd7a34fa8cddbdd61fa9 (diff)
downloadbcm5719-llvm-47f615eae51a51cae58a8c9c0422c95ada7f5204.tar.gz
bcm5719-llvm-47f615eae51a51cae58a8c9c0422c95ada7f5204.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DIE.h')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DIE.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DIE.h b/llvm/lib/CodeGen/AsmPrinter/DIE.h
index e28ddd38bc4..1655c8f1b20 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIE.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DIE.h
@@ -26,6 +26,7 @@ namespace llvm {
class MCSymbol;
class MCSymbolRefExpr;
class raw_ostream;
+ class DwarfTypeUnit;
//===--------------------------------------------------------------------===//
/// DIEAbbrevData - Dwarf abbreviation data, describes one attribute of a
@@ -195,6 +196,7 @@ namespace llvm {
isLabel,
isDelta,
isEntry,
+ isTypeSignature,
isBlock
};
protected:
@@ -412,6 +414,33 @@ namespace llvm {
};
//===--------------------------------------------------------------------===//
+ /// \brief A signature reference to a type unit.
+ class DIETypeSignature : public DIEValue {
+ const DwarfTypeUnit &Unit;
+ public:
+ explicit DIETypeSignature(const DwarfTypeUnit &Unit)
+ : DIEValue(isTypeSignature), Unit(Unit) {}
+
+ /// \brief Emit type unit signature.
+ virtual void EmitValue(AsmPrinter *Asm, dwarf::Form Form) const;
+
+ /// Returns size of a ref_sig8 entry.
+ virtual unsigned SizeOf(AsmPrinter *AP, dwarf::Form Form) const {
+ assert(Form == dwarf::DW_FORM_ref_sig8);
+ return 8;
+ }
+
+ // \brief Implement isa/cast/dyncast.
+ static bool classof(const DIEValue *E) {
+ return E->getType() == isTypeSignature;
+ }
+#ifndef NDEBUG
+ virtual void print(raw_ostream &O) const;
+ void dump() const;
+#endif
+ };
+
+ //===--------------------------------------------------------------------===//
/// DIEBlock - A block of values. Primarily used for location expressions.
//
class DIEBlock : public DIEValue, public DIE {
OpenPOWER on IntegriCloud