diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-12-17 23:32:35 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-12-17 23:32:35 +0000 |
commit | 2cb3295a536957f0a191660a692e84e4102054a6 (patch) | |
tree | ccc883fed100fe9a6c5fa3c0fb996c235ab7ed41 /lib/CodeGen/AsmPrinter/DIE.h | |
parent | f07d462beb3edb6f17ad06893cc74df96f2e4b60 (diff) | |
download | llvm-2cb3295a536957f0a191660a692e84e4102054a6.tar.gz llvm-2cb3295a536957f0a191660a692e84e4102054a6.tar.bz2 llvm-2cb3295a536957f0a191660a692e84e4102054a6.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIE.h')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DIE.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.h b/lib/CodeGen/AsmPrinter/DIE.h index e28ddd38bc..1655c8f1b2 100644 --- a/lib/CodeGen/AsmPrinter/DIE.h +++ b/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 { |