diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-11-19 23:08:21 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-11-19 23:08:21 +0000 |
commit | 409dd9c34aa3bef7b1234301f40ce3c35a58145c (patch) | |
tree | c7c9ff9bdd8f6f3ae7e97b71af15200f0e26dc31 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | |
parent | 2ea848b972d7d3dc5c0e525ba2795941d10e7748 (diff) | |
download | bcm5719-llvm-409dd9c34aa3bef7b1234301f40ce3c35a58145c.tar.gz bcm5719-llvm-409dd9c34aa3bef7b1234301f40ce3c35a58145c.zip |
DebugInfo: Partial implementation of DWARF type units.
Emit DW_TAG_type_units into the debug_info section using compile unit
headers. This is bogus/unusable by debuggers, but testable and provides
more isolated review.
Subsequent patches will include support for type unit headers and
emission into the debug_types section, as well as comdat grouping the
types based on their hash. Also the CompileUnit type will be renamed
'Unit' and relevant portions pulled out into respective CompileUnit and
TypeUnit types.
llvm-svn: 195166
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h index 02f4206e949..3a0c6be0acf 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h @@ -93,14 +93,18 @@ class CompileUnit { // DIEIntegerOne - A preallocated DIEValue because 1 is used frequently. DIEInteger *DIEIntegerOne; + uint16_t Language; + public: CompileUnit(unsigned UID, DIE *D, DICompileUnit CU, AsmPrinter *A, DwarfDebug *DW, DwarfUnits *DWU); + CompileUnit(unsigned UID, DIE *D, uint16_t Language, AsmPrinter *A, + DwarfDebug *DW, DwarfUnits *DWU); ~CompileUnit(); // Accessors. unsigned getUniqueID() const { return UniqueID; } - uint16_t getLanguage() const { return Node.getLanguage(); } + uint16_t getLanguage() const { return Language; } DICompileUnit getNode() const { return Node; } DIE *getCUDie() const { return CUDie.get(); } const StringMap<DIE *> &getGlobalNames() const { return GlobalNames; } @@ -311,6 +315,9 @@ public: DIE *getOrCreateTypeDIE(const MDNode *N); /// getOrCreateContextDIE - Get context owner's DIE. + DIE *createTypeDIE(DICompositeType Ty); + + /// getOrCreateContextDIE - Get context owner's DIE. DIE *getOrCreateContextDIE(DIScope Context); /// createGlobalVariableDIE - create global variable DIE. @@ -328,6 +335,10 @@ public: DIE *createAndAddDIE(unsigned Tag, DIE &Parent, DIDescriptor N = DIDescriptor()); + /// constructTypeDIEImpl - Construct type DIE that is not a type unit + /// reference from a DICompositeType. + void constructTypeDIEImpl(DIE &Buffer, DICompositeType CTy); + /// Compute the size of a header for this unit, not including the initial /// length field. unsigned getHeaderSize() const { |