136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines//===-- llvm/CodeGen/DwarfUnit.h - Dwarf Compile Unit ---*- C++ -*--===// 236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// 336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// The LLVM Compiler Infrastructure 436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// 536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// This file is distributed under the University of Illinois Open Source 636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// License. See LICENSE.TXT for details. 736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// 836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines//===----------------------------------------------------------------------===// 936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// 1036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// This file contains support for writing dwarf compile unit. 1136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// 1236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines//===----------------------------------------------------------------------===// 1336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 1437ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H 1537ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines#define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H 1636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 1736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "DwarfDebug.h" 1836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/ADT/DenseMap.h" 1936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/ADT/Optional.h" 2036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/ADT/StringMap.h" 2136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/CodeGen/AsmPrinter.h" 22ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines#include "llvm/CodeGen/DIE.h" 2336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/IR/DIBuilder.h" 2436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/IR/DebugInfo.h" 25ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines#include "llvm/MC/MCDwarf.h" 2636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/MC/MCExpr.h" 2736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#include "llvm/MC/MCSection.h" 2836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 2936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesnamespace llvm { 3036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 3136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass MachineLocation; 3236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass MachineOperand; 3336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass ConstantInt; 3436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass ConstantFP; 3536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass DbgVariable; 3636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass DwarfCompileUnit; 3736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 3836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines// Data structure to hold a range for range lists. 3936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass RangeSpan { 4036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinespublic: 4136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines RangeSpan(MCSymbol *S, MCSymbol *E) : Start(S), End(E) {} 4236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines const MCSymbol *getStart() const { return Start; } 4336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines const MCSymbol *getEnd() const { return End; } 4436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void setEnd(const MCSymbol *E) { End = E; } 4536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 4636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesprivate: 4736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines const MCSymbol *Start, *End; 4836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines}; 4936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 5036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass RangeSpanList { 5136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesprivate: 5236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines // Index for locating within the debug_range section this particular span. 5336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines MCSymbol *RangeSym; 5436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines // List of ranges. 5536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines SmallVector<RangeSpan, 2> Ranges; 5636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 5736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinespublic: 5837ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines RangeSpanList(MCSymbol *Sym, SmallVector<RangeSpan, 2> Ranges) 5937ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines : RangeSym(Sym), Ranges(std::move(Ranges)) {} 6036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines MCSymbol *getSym() const { return RangeSym; } 6136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines const SmallVectorImpl<RangeSpan> &getRanges() const { return Ranges; } 6236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void addRange(RangeSpan Range) { Ranges.push_back(Range); } 6336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines}; 6436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 6536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines//===----------------------------------------------------------------------===// 666948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar/// This dwarf writer support class manages information associated with a 676948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar/// source file. 6836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass DwarfUnit { 6936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesprotected: 706948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// A numeric ID unique among all CUs in the module 7136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines unsigned UniqueID; 7236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 736948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// MDNode for the compile unit. 746948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar const DICompileUnit *CUNode; 7536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 76cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar // All DIEValues are allocated through this allocator. 77cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar BumpPtrAllocator DIEValueAllocator; 78cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar 7936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// Unit debug information entry. 80cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar DIE &UnitDie; 8136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 8236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// Offset of the UnitDie from beginning of debug info section. 8336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines unsigned DebugInfoOffset; 8436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 856948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// Target of Dwarf emission. 8636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines AsmPrinter *Asm; 8736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 8836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines // Holders for some common dwarf information. 8936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DwarfDebug *DD; 9036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DwarfFile *DU; 9136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 926948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// An anonymous type for index type. Owned by UnitDie. 9336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DIE *IndexTyDie; 9436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 956948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// Tracks the mapping of unit level debug information variables to debug 966948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// information entries. 9736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DenseMap<const MDNode *, DIE *> MDNodeToDieMap; 9836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 996948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// A list of all the DIEBlocks in use. 10036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines std::vector<DIEBlock *> DIEBlocks; 1016948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar 1026948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// A list of all the DIELocs in use. 10336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines std::vector<DIELoc *> DIELocs; 10436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 1056948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// This map is used to keep track of subprogram DIEs that need 1066948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// DW_AT_containing_type attribute. This attribute points to a DIE that 10736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// corresponds to the MDNode mapped with the subprogram DIE. 1086948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DenseMap<DIE *, const DINode *> ContainingTypeMap; 10936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 11036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// The section this unit will be emitted in. 1116948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar MCSection *Section; 11236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 1136948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DwarfUnit(unsigned UID, dwarf::Tag, const DICompileUnit *CU, AsmPrinter *A, 11437ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines DwarfDebug *DW, DwarfFile *DWU); 11536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 1166948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar bool applySubprogramDefinitionAttributes(const DISubprogram *SP, DIE &SPDie); 11736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 11836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinespublic: 11936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines virtual ~DwarfUnit(); 12036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 1216948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void initSection(MCSection *Section); 1224c5e43da7792f75567b693105cc53e3f1992ad98Pirama Arumuga Nainar 1236948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar MCSection *getSection() const { 12436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines assert(Section); 12536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines return Section; 12636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines } 12736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 12836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines // Accessors. 129ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines AsmPrinter* getAsmPrinter() const { return Asm; } 13036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines unsigned getUniqueID() const { return UniqueID; } 1310c7f116bb6950ef819323d855415b2f2b0aad987Pirama Arumuga Nainar uint16_t getLanguage() const { return CUNode->getSourceLanguage(); } 1326948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar const DICompileUnit *getCUNode() const { return CUNode; } 133dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines DIE &getUnitDie() { return UnitDie; } 13436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 13536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines unsigned getDebugInfoOffset() const { return DebugInfoOffset; } 13636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void setDebugInfoOffset(unsigned DbgInfoOff) { DebugInfoOffset = DbgInfoOff; } 13736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 138cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Return true if this compile unit has something to write out. 1396948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar bool hasContent() const { return UnitDie.hasChildren(); } 14036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 141cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Get string containing language specific context for a global name. 1426948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// 1436948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// Walks the metadata parent chain in a language specific manner (using the 1446948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// compile unit language) and returns it as a string. This is done at the 1456948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// metadata level because DIEs may not currently have been added to the 1466948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// parent context and walking the DIEs looking for names is more expensive 1476948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// than walking the metadata. 1486948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar std::string getParentContextString(const DIScope *Context) const; 14936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 15037ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines /// Add a new global name to the compile unit. 1516948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar virtual void addGlobalName(StringRef Name, DIE &Die, const DIScope *Context) { 1526948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar } 15337ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines 15437ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines /// Add a new global type to the compile unit. 1556948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar virtual void addGlobalType(const DIType *Ty, const DIE &Die, 1566948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar const DIScope *Context) {} 15736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 158cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Returns the DIE map slot for the specified debug variable. 1596948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// 1606948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// We delegate the request to DwarfDebug when the MDNode can be part of the 1616948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// type system, since DIEs for the type system can be shared across CUs and 1626948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// the mappings are kept in DwarfDebug. 1636948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIE *getDIE(const DINode *D) const; 16436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 165cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Returns a fresh newly allocated DIELoc. 1666948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIELoc *getDIELoc() { return new (DIEValueAllocator) DIELoc; } 16736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 168cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Insert DIE into the map. 1696948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// 1706948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// We delegate the request to DwarfDebug when the MDNode can be part of the 1716948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// type system, since DIEs for the type system can be shared across CUs and 1726948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// the mappings are kept in DwarfDebug. 1736948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void insertDIE(const DINode *Desc, DIE *D); 17436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 175cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a flag that is true to the DIE. 176dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addFlag(DIE &Die, dwarf::Attribute Attribute); 17736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 178cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add an unsigned integer attribute data and value. 179cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, 180cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar Optional<dwarf::Form> Form, uint64_t Integer); 18136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 182cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar void addUInt(DIEValueList &Block, dwarf::Form Form, uint64_t Integer); 18336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 184cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add an signed integer attribute data and value. 185cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar void addSInt(DIEValueList &Die, dwarf::Attribute Attribute, 186cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar Optional<dwarf::Form> Form, int64_t Integer); 18736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 188dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addSInt(DIELoc &Die, Optional<dwarf::Form> Form, int64_t Integer); 18936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 190cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a string attribute data and value. 1916948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// 1926948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// We always emit a reference to the string pool instead of immediate 1936948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// strings so that DIEs have more predictable sizes. In the case of split 1946948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// dwarf we emit an index into another table which gets us the static offset 1956948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// into the string table. 19637ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str); 19736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 198cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a Dwarf label attribute data and value. 199cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar DIEValueList::value_iterator addLabel(DIEValueList &Die, 200cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar dwarf::Attribute Attribute, 201cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar dwarf::Form Form, 202cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar const MCSymbol *Label); 20336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 204dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addLabel(DIELoc &Die, dwarf::Form Form, const MCSymbol *Label); 20536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 206cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add an offset into a section attribute data and value. 207dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer); 20836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 209cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a dwarf op address data and value using the form given and an 2106948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// op of either DW_FORM_addr or DW_FORM_GNU_addr_index. 211dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addOpAddress(DIELoc &Die, const MCSymbol *Label); 21236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 213cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a label delta attribute data and value. 214dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addLabelDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, 21536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines const MCSymbol *Lo); 21636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 217cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a DIE attribute data and value. 218dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry); 21936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 220cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a DIE attribute data and value. 2216948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIEEntry Entry); 22236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 223cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a type's DW_AT_signature and set the declaration flag. 224dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addDIETypeSignature(DIE &Die, const DwarfTypeUnit &Type); 225cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add an attribute containing the type signature for a unique identifier. 226cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar void addDIETypeSignature(DIE &Die, dwarf::Attribute Attribute, 227cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar StringRef Identifier); 22836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 229cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add block data. 230dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Block); 23136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 232cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add block data. 233dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addBlock(DIE &Die, dwarf::Attribute Attribute, DIEBlock *Block); 23436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 235cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add location information to specified debug information entry. 236dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addSourceLine(DIE &Die, unsigned Line, StringRef File, 23736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines StringRef Directory); 2386948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addSourceLine(DIE &Die, const DILocalVariable *V); 2396948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addSourceLine(DIE &Die, const DIGlobalVariable *G); 2406948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addSourceLine(DIE &Die, const DISubprogram *SP); 2416948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addSourceLine(DIE &Die, const DIType *Ty); 2426948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addSourceLine(DIE &Die, const DINamespace *NS); 2436948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addSourceLine(DIE &Die, const DIObjCProperty *Ty); 2446948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar 245cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add constant value entry in variable DIE. 2466948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addConstantValue(DIE &Die, const MachineOperand &MO, const DIType *Ty); 2476948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addConstantValue(DIE &Die, const ConstantInt *CI, const DIType *Ty); 2486948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addConstantValue(DIE &Die, const APInt &Val, const DIType *Ty); 249dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addConstantValue(DIE &Die, const APInt &Val, bool Unsigned); 250dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addConstantValue(DIE &Die, bool Unsigned, uint64_t Val); 25136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 252cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add constant value entry in variable DIE. 253dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addConstantFPValue(DIE &Die, const MachineOperand &MO); 254dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addConstantFPValue(DIE &Die, const ConstantFP *CFP); 25536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 256cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a linkage name, if it isn't empty. 2574c5e43da7792f75567b693105cc53e3f1992ad98Pirama Arumuga Nainar void addLinkageName(DIE &Die, StringRef LinkageName); 2584c5e43da7792f75567b693105cc53e3f1992ad98Pirama Arumuga Nainar 259cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add template parameters in buffer. 2606948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addTemplateParams(DIE &Buffer, DINodeArray TParams); 26136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 262cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add register operand. 263ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines /// \returns false if the register does not exist, e.g., because it was never 264ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines /// materialized. 265ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines bool addRegisterOpPiece(DIELoc &TheDie, unsigned Reg, 26637ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines unsigned SizeInBits = 0, unsigned OffsetInBits = 0); 26736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 268cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add register offset. 269ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines /// \returns false if the register does not exist, e.g., because it was never 270ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines /// materialized. 271ebe69fe11e48d322045d5949c83283927a0d790bStephen Hines bool addRegisterOffset(DIELoc &TheDie, unsigned Reg, int64_t Offset); 27236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 27336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines // FIXME: Should be reformulated in terms of addComplexAddress. 2746948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// Start with the address based on the location provided, and generate the 2756948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// DWARF information necessary to find the actual Block variable (navigating 2766948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// the Block struct) based on the starting location. Add the DWARF 2776948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// information to the die. Obsolete, please use addComplexAddress instead. 278dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines void addBlockByrefAddress(const DbgVariable &DV, DIE &Die, 27936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines dwarf::Attribute Attribute, 28036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines const MachineLocation &Location); 28136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 282cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Add a new type attribute to the specified entity. 2836948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// 2846948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// This takes and attribute parameter because DW_AT_friend attributes are 2856948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// also type references. 2866948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void addType(DIE &Entity, const DIType *Ty, 28736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines dwarf::Attribute Attribute = dwarf::DW_AT_type); 28836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 2896948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIE *getOrCreateNameSpace(const DINamespace *NS); 290cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar DIE *getOrCreateModule(const DIModule *M); 2916948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIE *getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal = false); 29236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 2936948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, 29437ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines bool Minimal = false); 295dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines 296cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Find existing DIE or create new DIE for the given type. 29736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DIE *getOrCreateTypeDIE(const MDNode *N); 29836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 299cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Get context owner's DIE. 3006948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIE *createTypeDIE(const DICompositeType *Ty); 30136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 302cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Get context owner's DIE. 3036948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIE *getOrCreateContextDIE(const DIScope *Context); 30436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 305cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Construct DIEs for types that contain vtables. 30636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void constructContainingTypeDIEs(); 30736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 308cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Construct function argument DIEs. 3096948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args); 31036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 31136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// Create a DIE with the given Tag, add the DIE to its parent, and 31236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// call insertDIE if MD is not null. 3136948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIE &createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N = nullptr); 31436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 31536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// Compute the size of a header for this unit, not including the initial 31636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// length field. 31736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines virtual unsigned getHeaderSize() const { 31836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines return sizeof(int16_t) + // DWARF version number 31936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines sizeof(int32_t) + // Offset Into Abbrev. Section 32036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines sizeof(int8_t); // Pointer Size (in bytes) 32136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines } 32236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 32336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// Emit the header for this unit, not including the initial length field. 3244c5e43da7792f75567b693105cc53e3f1992ad98Pirama Arumuga Nainar virtual void emitHeader(bool UseOffsets); 32536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 32636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines virtual DwarfCompileUnit &getCU() = 0; 32736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 3286948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy); 329dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines 33036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesprotected: 331cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Create new static data member DIE. 3326948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar DIE *getOrCreateStaticMemberDIE(const DIDerivedType *DT); 33336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 33436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// Look up the source ID with the given directory and source file names. If 33536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// none currently exists, create a new ID and insert it in the line table. 33636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines virtual unsigned getOrCreateSourceID(StringRef File, StringRef Directory) = 0; 33736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 338cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Look in the DwarfDebug map for the MDNode that corresponds to the 3396948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// reference. 3406948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar template <typename T> T *resolve(TypedDINodeRef<T> Ref) const { 34137ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines return DD->resolve(Ref); 34237ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines } 343dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines 34437ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hinesprivate: 3456948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructTypeDIE(DIE &Buffer, const DIBasicType *BTy); 3466948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy); 3476948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructTypeDIE(DIE &Buffer, const DISubroutineType *DTy); 3486948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructSubrangeDIE(DIE &Buffer, const DISubrange *SR, DIE *IndexTy); 3496948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructArrayTypeDIE(DIE &Buffer, const DICompositeType *CTy); 3506948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructEnumTypeDIE(DIE &Buffer, const DICompositeType *CTy); 3516948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void constructMemberDIE(DIE &Buffer, const DIDerivedType *DT); 35236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void constructTemplateTypeParameterDIE(DIE &Buffer, 3536948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar const DITemplateTypeParameter *TP); 35436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void constructTemplateValueParameterDIE(DIE &Buffer, 3556948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar const DITemplateValueParameter *TVP); 35636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 357cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Return the default lower bound for an array. 3586948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// 3596948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar /// If the DWARF version doesn't handle the language, return -1. 36036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines int64_t getDefaultLowerBound() const; 36136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 362cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Get an anonymous type for index type. 36337ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines DIE *getIndexTyDie(); 36436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 365cddc3e03e4ec99c0268c03a126195173e519ed58Pirama Arumuga Nainar /// Set D as anonymous type for index which can be reused later. 36636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void setIndexTyDie(DIE *D) { IndexTyDie = D; } 36736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 36836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// If this is a named finished type then include it in the list of types for 36936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// the accelerator tables. 3706948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar void updateAcceleratorTables(const DIScope *Context, const DIType *Ty, 3716948897e478cbd66626159776a8017b3c18579b9Pirama Arumuga Nainar const DIE &TyDIE); 37236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 37337ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines virtual bool isDwoUnit() const = 0; 37436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines}; 37536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 37636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinesclass DwarfTypeUnit : public DwarfUnit { 37736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines uint64_t TypeSignature; 37836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines const DIE *Ty; 37936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DwarfCompileUnit &CU; 38036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines MCDwarfDwoLineTable *SplitLineTable; 38136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 38237ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines unsigned getOrCreateSourceID(StringRef File, StringRef Directory) override; 38337ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines bool isDwoUnit() const override; 38437ed9c199ca639565f6ce88105f9e39e898d82d0Stephen Hines 38536b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hinespublic: 386dce4a407a24b04eebc6a376f8e62b41aaa7b071fStephen Hines DwarfTypeUnit(unsigned UID, DwarfCompileUnit &CU, AsmPrinter *A, 38736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DwarfDebug *DW, DwarfFile *DWU, 38836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines MCDwarfDwoLineTable *SplitLineTable = nullptr); 38936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 39036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void setTypeSignature(uint64_t Signature) { TypeSignature = Signature; } 39136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines uint64_t getTypeSignature() const { return TypeSignature; } 39236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines void setType(const DIE *Ty) { this->Ty = Ty; } 39336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines 39436b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines /// Emit the header for this unit, not including the initial length field. 3954c5e43da7792f75567b693105cc53e3f1992ad98Pirama Arumuga Nainar void emitHeader(bool UseOffsets) override; 39636b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines unsigned getHeaderSize() const override { 39736b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines return DwarfUnit::getHeaderSize() + sizeof(uint64_t) + // Type Signature 39836b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines sizeof(uint32_t); // Type DIE Offset 39936b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines } 40036b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines DwarfCompileUnit &getCU() override { return CU; } 40136b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines}; 40236b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines} // end llvm namespace 40336b56886974eae4f9c5ebc96befd3e7bfe5de338Stephen Hines#endif 404