1 //===-- llvm/CodeGen/DwarfUnit.h - Dwarf Compile Unit ---*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains support for writing dwarf compile unit.
12 //===----------------------------------------------------------------------===//
14 #ifndef CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
15 #define CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
18 #include "DwarfDebug.h"
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/StringMap.h"
22 #include "llvm/CodeGen/AsmPrinter.h"
23 #include "llvm/IR/DIBuilder.h"
24 #include "llvm/IR/DebugInfo.h"
25 #include "llvm/MC/MCExpr.h"
26 #include "llvm/MC/MCSection.h"
27 #include "llvm/MC/MCDwarf.h"
31 class MachineLocation;
36 class DwarfCompileUnit;
38 // Data structure to hold a range for range lists.
41 RangeSpan(MCSymbol *S, MCSymbol *E) : Start(S), End(E) {}
42 const MCSymbol *getStart() const { return Start; }
43 const MCSymbol *getEnd() const { return End; }
46 const MCSymbol *Start, *End;
51 // Index for locating within the debug_range section this particular span.
54 SmallVector<RangeSpan, 2> Ranges;
57 RangeSpanList(MCSymbol *Sym) : RangeSym(Sym) {}
58 MCSymbol *getSym() const { return RangeSym; }
59 const SmallVectorImpl<RangeSpan> &getRanges() const { return Ranges; }
60 void addRange(RangeSpan Range) { Ranges.push_back(Range); }
63 //===----------------------------------------------------------------------===//
64 /// Unit - This dwarf writer support class manages information associated
65 /// with a source file.
68 /// UniqueID - a numeric ID unique among all CUs in the module
71 /// Node - MDNode for the compile unit.
74 /// Unit debug information entry.
75 const std::unique_ptr<DIE> UnitDie;
77 /// Offset of the UnitDie from beginning of debug info section.
78 unsigned DebugInfoOffset;
80 /// Asm - Target of Dwarf emission.
83 // Holders for some common dwarf information.
87 /// IndexTyDie - An anonymous type for index type. Owned by UnitDie.
90 /// MDNodeToDieMap - Tracks the mapping of unit level debug information
91 /// variables to debug information entries.
92 DenseMap<const MDNode *, DIE *> MDNodeToDieMap;
94 /// MDNodeToDIEEntryMap - Tracks the mapping of unit level debug information
95 /// descriptors to debug information entries using a DIEEntry proxy.
96 DenseMap<const MDNode *, DIEEntry *> MDNodeToDIEEntryMap;
98 /// GlobalNames - A map of globally visible named entities for this unit.
99 StringMap<const DIE *> GlobalNames;
101 /// GlobalTypes - A map of globally visible types for this unit.
102 StringMap<const DIE *> GlobalTypes;
104 /// AccelNames - A map of names for the name accelerator table.
105 StringMap<std::vector<const DIE *> > AccelNames;
107 /// AccelObjC - A map of objc spec for the objc accelerator table.
108 StringMap<std::vector<const DIE *> > AccelObjC;
110 /// AccelNamespace - A map of names for the namespace accelerator table.
111 StringMap<std::vector<const DIE *> > AccelNamespace;
113 /// AccelTypes - A map of names for the type accelerator table.
114 StringMap<std::vector<std::pair<const DIE *, unsigned> > > AccelTypes;
116 /// DIEBlocks - A list of all the DIEBlocks in use.
117 std::vector<DIEBlock *> DIEBlocks;
119 /// DIELocs - A list of all the DIELocs in use.
120 std::vector<DIELoc *> DIELocs;
122 /// ContainingTypeMap - This map is used to keep track of subprogram DIEs that
123 /// need DW_AT_containing_type attribute. This attribute points to a DIE that
124 /// corresponds to the MDNode mapped with the subprogram DIE.
125 DenseMap<DIE *, const MDNode *> ContainingTypeMap;
127 // List of ranges for a given compile unit.
128 SmallVector<RangeSpan, 1> CURanges;
130 // List of range lists for a given compile unit, separate from the ranges for
132 SmallVector<RangeSpanList, 1> CURangeLists;
134 // DIEValueAllocator - All DIEValues are allocated through this allocator.
135 BumpPtrAllocator DIEValueAllocator;
137 // DIEIntegerOne - A preallocated DIEValue because 1 is used frequently.
138 DIEInteger *DIEIntegerOne;
140 /// The section this unit will be emitted in.
141 const MCSection *Section;
143 /// A label at the start of the non-dwo section related to this unit.
144 MCSymbol *SectionSym;
146 /// The start of the unit within its section.
147 MCSymbol *LabelBegin;
149 /// The end of the unit within its section.
152 /// The label for the start of the range sets for the elements of this unit.
153 MCSymbol *LabelRange;
155 /// Skeleton unit associated with this unit.
158 DwarfUnit(unsigned UID, DIE *D, DICompileUnit CU, AsmPrinter *A,
159 DwarfDebug *DW, DwarfFile *DWU);
162 virtual ~DwarfUnit();
164 /// Set the skeleton unit associated with this unit.
165 void setSkeleton(DwarfUnit *Skel) { Skeleton = Skel; }
167 /// Get the skeleton unit associated with this unit.
168 DwarfUnit *getSkeleton() const { return Skeleton; }
170 /// Pass in the SectionSym even though we could recreate it in every compile
171 /// unit (type units will have actually distinct symbols once they're in
172 /// comdat sections).
173 void initSection(const MCSection *Section, MCSymbol *SectionSym) {
174 assert(!this->Section);
175 this->Section = Section;
176 this->SectionSym = SectionSym;
178 Asm->GetTempSymbol(Section->getLabelBeginName(), getUniqueID());
180 Asm->GetTempSymbol(Section->getLabelEndName(), getUniqueID());
181 this->LabelRange = Asm->GetTempSymbol("gnu_ranges", getUniqueID());
184 const MCSection *getSection() const {
189 /// If there's a skeleton then return the section symbol for the skeleton
190 /// unit, otherwise return the section symbol for this unit.
191 MCSymbol *getLocalSectionSym() const {
193 return Skeleton->getSectionSym();
194 return getSectionSym();
197 MCSymbol *getSectionSym() const {
202 /// If there's a skeleton then return the begin label for the skeleton unit,
203 /// otherwise return the local label for this unit.
204 MCSymbol *getLocalLabelBegin() const {
206 return Skeleton->getLabelBegin();
207 return getLabelBegin();
210 MCSymbol *getLabelBegin() const {
215 MCSymbol *getLabelEnd() const {
220 MCSymbol *getLabelRange() const {
226 unsigned getUniqueID() const { return UniqueID; }
227 uint16_t getLanguage() const { return CUNode.getLanguage(); }
228 DICompileUnit getCUNode() const { return CUNode; }
229 DIE *getUnitDie() const { return UnitDie.get(); }
230 const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; }
231 const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; }
233 const StringMap<std::vector<const DIE *> > &getAccelNames() const {
236 const StringMap<std::vector<const DIE *> > &getAccelObjC() const {
239 const StringMap<std::vector<const DIE *> > &getAccelNamespace() const {
240 return AccelNamespace;
242 const StringMap<std::vector<std::pair<const DIE *, unsigned> > > &
243 getAccelTypes() const {
247 unsigned getDebugInfoOffset() const { return DebugInfoOffset; }
248 void setDebugInfoOffset(unsigned DbgInfoOff) { DebugInfoOffset = DbgInfoOff; }
250 /// hasContent - Return true if this compile unit has something to write out.
251 bool hasContent() const { return !UnitDie->getChildren().empty(); }
253 /// addRange - Add an address range to the list of ranges for this unit.
254 void addRange(RangeSpan Range) {
255 // Only add a range for this unit if we're emitting full debug.
256 if (getCUNode().getEmissionKind() == DIBuilder::FullDebug)
257 CURanges.push_back(Range);
260 /// getRanges - Get the list of ranges for this unit.
261 const SmallVectorImpl<RangeSpan> &getRanges() const { return CURanges; }
262 SmallVectorImpl<RangeSpan> &getRanges() { return CURanges; }
264 /// addRangeList - Add an address range list to the list of range lists.
265 void addRangeList(RangeSpanList Ranges) { CURangeLists.push_back(Ranges); }
267 /// getRangeLists - Get the vector of range lists.
268 const SmallVectorImpl<RangeSpanList> &getRangeLists() const {
271 SmallVectorImpl<RangeSpanList> &getRangeLists() { return CURangeLists; }
273 /// getParentContextString - Get a string containing the language specific
274 /// context for a global name.
275 std::string getParentContextString(DIScope Context) const;
277 /// addGlobalName - Add a new global entity to the compile unit.
279 void addGlobalName(StringRef Name, DIE *Die, DIScope Context);
281 /// addAccelName - Add a new name to the name accelerator table.
282 void addAccelName(StringRef Name, const DIE *Die);
284 /// addAccelObjC - Add a new name to the ObjC accelerator table.
285 void addAccelObjC(StringRef Name, const DIE *Die);
287 /// addAccelNamespace - Add a new name to the namespace accelerator table.
288 void addAccelNamespace(StringRef Name, const DIE *Die);
290 /// addAccelType - Add a new type to the type accelerator table.
291 void addAccelType(StringRef Name, std::pair<const DIE *, unsigned> Die);
293 /// getDIE - Returns the debug information entry map slot for the
294 /// specified debug variable. We delegate the request to DwarfDebug
295 /// when the MDNode can be part of the type system, since DIEs for
296 /// the type system can be shared across CUs and the mappings are
297 /// kept in DwarfDebug.
298 DIE *getDIE(DIDescriptor D) const;
300 /// getDIELoc - Returns a fresh newly allocated DIELoc.
301 DIELoc *getDIELoc() { return new (DIEValueAllocator) DIELoc(); }
303 /// insertDIE - Insert DIE into the map. We delegate the request to DwarfDebug
304 /// when the MDNode can be part of the type system, since DIEs for
305 /// the type system can be shared across CUs and the mappings are
306 /// kept in DwarfDebug.
307 void insertDIE(DIDescriptor Desc, DIE *D);
309 /// addDie - Adds or interns the DIE to the compile unit.
311 void addDie(DIE *Buffer) { UnitDie->addChild(Buffer); }
313 /// addFlag - Add a flag that is true to the DIE.
314 void addFlag(DIE *Die, dwarf::Attribute Attribute);
316 /// addUInt - Add an unsigned integer attribute data and value.
317 void addUInt(DIE *Die, dwarf::Attribute Attribute, Optional<dwarf::Form> Form,
320 void addUInt(DIE *Block, dwarf::Form Form, uint64_t Integer);
322 /// addSInt - Add an signed integer attribute data and value.
323 void addSInt(DIE *Die, dwarf::Attribute Attribute, Optional<dwarf::Form> Form,
326 void addSInt(DIELoc *Die, Optional<dwarf::Form> Form, int64_t Integer);
328 /// addString - Add a string attribute data and value.
329 void addString(DIE *Die, dwarf::Attribute Attribute, const StringRef Str);
331 /// addLocalString - Add a string attribute data and value.
332 void addLocalString(DIE *Die, dwarf::Attribute Attribute,
333 const StringRef Str);
335 /// addExpr - Add a Dwarf expression attribute data and value.
336 void addExpr(DIELoc *Die, dwarf::Form Form, const MCExpr *Expr);
338 /// addLabel - Add a Dwarf label attribute data and value.
339 void addLabel(DIE *Die, dwarf::Attribute Attribute, dwarf::Form Form,
340 const MCSymbol *Label);
342 void addLabel(DIELoc *Die, dwarf::Form Form, const MCSymbol *Label);
344 /// addLocationList - Add a Dwarf loclistptr attribute data and value.
345 void addLocationList(DIE *Die, dwarf::Attribute Attribute, unsigned Index);
347 /// addSectionLabel - Add a Dwarf section label attribute data and value.
349 void addSectionLabel(DIE *Die, dwarf::Attribute Attribute,
350 const MCSymbol *Label);
352 /// addSectionOffset - Add an offset into a section attribute data and value.
354 void addSectionOffset(DIE *Die, dwarf::Attribute Attribute, uint64_t Integer);
356 /// addOpAddress - Add a dwarf op address data and value using the
357 /// form given and an op of either DW_FORM_addr or DW_FORM_GNU_addr_index.
358 void addOpAddress(DIELoc *Die, const MCSymbol *Label);
360 /// addSectionDelta - Add a label delta attribute data and value.
361 void addSectionDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi,
364 /// addLabelDelta - Add a label delta attribute data and value.
365 void addLabelDelta(DIE *Die, dwarf::Attribute Attribute, const MCSymbol *Hi,
368 /// addDIEEntry - Add a DIE attribute data and value.
369 void addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIE *Entry);
371 /// addDIEEntry - Add a DIE attribute data and value.
372 void addDIEEntry(DIE *Die, dwarf::Attribute Attribute, DIEEntry *Entry);
374 void addDIETypeSignature(DIE *Die, const DwarfTypeUnit &Type);
376 /// addBlock - Add block data.
377 void addBlock(DIE *Die, dwarf::Attribute Attribute, DIELoc *Block);
379 /// addBlock - Add block data.
380 void addBlock(DIE *Die, dwarf::Attribute Attribute, DIEBlock *Block);
382 /// addSourceLine - Add location information to specified debug information
384 void addSourceLine(DIE *Die, unsigned Line, StringRef File,
385 StringRef Directory);
386 void addSourceLine(DIE *Die, DIVariable V);
387 void addSourceLine(DIE *Die, DIGlobalVariable G);
388 void addSourceLine(DIE *Die, DISubprogram SP);
389 void addSourceLine(DIE *Die, DIType Ty);
390 void addSourceLine(DIE *Die, DINameSpace NS);
391 void addSourceLine(DIE *Die, DIObjCProperty Ty);
393 /// addAddress - Add an address attribute to a die based on the location
395 void addAddress(DIE *Die, dwarf::Attribute Attribute,
396 const MachineLocation &Location, bool Indirect = false);
398 /// addConstantValue - Add constant value entry in variable DIE.
399 void addConstantValue(DIE *Die, const MachineOperand &MO, DIType Ty);
400 void addConstantValue(DIE *Die, const ConstantInt *CI, bool Unsigned);
401 void addConstantValue(DIE *Die, const APInt &Val, bool Unsigned);
403 /// addConstantFPValue - Add constant value entry in variable DIE.
404 void addConstantFPValue(DIE *Die, const MachineOperand &MO);
405 void addConstantFPValue(DIE *Die, const ConstantFP *CFP);
407 /// addTemplateParams - Add template parameters in buffer.
408 void addTemplateParams(DIE &Buffer, DIArray TParams);
410 /// addRegisterOp - Add register operand.
411 void addRegisterOp(DIELoc *TheDie, unsigned Reg);
413 /// addRegisterOffset - Add register offset.
414 void addRegisterOffset(DIELoc *TheDie, unsigned Reg, int64_t Offset);
416 /// addComplexAddress - Start with the address based on the location provided,
417 /// and generate the DWARF information necessary to find the actual variable
418 /// (navigating the extra location information encoded in the type) based on
419 /// the starting location. Add the DWARF information to the die.
420 void addComplexAddress(const DbgVariable &DV, DIE *Die,
421 dwarf::Attribute Attribute,
422 const MachineLocation &Location);
424 // FIXME: Should be reformulated in terms of addComplexAddress.
425 /// addBlockByrefAddress - Start with the address based on the location
426 /// provided, and generate the DWARF information necessary to find the
427 /// actual Block variable (navigating the Block struct) based on the
428 /// starting location. Add the DWARF information to the die. Obsolete,
429 /// please use addComplexAddress instead.
430 void addBlockByrefAddress(const DbgVariable &DV, DIE *Die,
431 dwarf::Attribute Attribute,
432 const MachineLocation &Location);
434 /// addVariableAddress - Add DW_AT_location attribute for a
435 /// DbgVariable based on provided MachineLocation.
436 void addVariableAddress(const DbgVariable &DV, DIE *Die,
437 MachineLocation Location);
439 /// addType - Add a new type attribute to the specified entity. This takes
440 /// and attribute parameter because DW_AT_friend attributes are also
442 void addType(DIE *Entity, DIType Ty,
443 dwarf::Attribute Attribute = dwarf::DW_AT_type);
445 /// getOrCreateNameSpace - Create a DIE for DINameSpace.
446 DIE *getOrCreateNameSpace(DINameSpace NS);
448 /// getOrCreateSubprogramDIE - Create new DIE using SP.
449 DIE *getOrCreateSubprogramDIE(DISubprogram SP);
451 /// getOrCreateTypeDIE - Find existing DIE or create new DIE for the
453 DIE *getOrCreateTypeDIE(const MDNode *N);
455 /// getOrCreateContextDIE - Get context owner's DIE.
456 DIE *createTypeDIE(DICompositeType Ty);
458 /// getOrCreateContextDIE - Get context owner's DIE.
459 DIE *getOrCreateContextDIE(DIScope Context);
461 /// constructContainingTypeDIEs - Construct DIEs for types that contain
463 void constructContainingTypeDIEs();
465 /// constructVariableDIE - Construct a DIE for the given DbgVariable.
466 DIE *constructVariableDIE(DbgVariable &DV, bool isScopeAbstract);
468 /// constructSubprogramArguments - Construct function argument DIEs.
469 void constructSubprogramArguments(DIE &Buffer, DIArray Args);
471 /// Create a DIE with the given Tag, add the DIE to its parent, and
472 /// call insertDIE if MD is not null.
473 DIE *createAndAddDIE(unsigned Tag, DIE &Parent,
474 DIDescriptor N = DIDescriptor());
476 /// Compute the size of a header for this unit, not including the initial
478 virtual unsigned getHeaderSize() const {
479 return sizeof(int16_t) + // DWARF version number
480 sizeof(int32_t) + // Offset Into Abbrev. Section
481 sizeof(int8_t); // Pointer Size (in bytes)
484 /// Emit the header for this unit, not including the initial length field.
485 virtual void emitHeader(const MCSection *ASection,
486 const MCSymbol *ASectionSym) const;
488 virtual DwarfCompileUnit &getCU() = 0;
490 /// \brief Return whether this compilation unit has the
491 /// one-definition-rule (ODR). In C++ this allows the compiler to
492 /// perform type unique during LTO.
493 bool hasODR() const {
494 switch (getLanguage()) {
495 case dwarf::DW_LANG_C_plus_plus:
496 case dwarf::DW_LANG_C_plus_plus_03:
497 case dwarf::DW_LANG_C_plus_plus_11:
498 // For all we care, the C++ part of the language has the ODR and
499 // ObjC methods are not represented in a way that they could be
500 // confused with C++ member functions.
501 case dwarf::DW_LANG_ObjC_plus_plus:
508 /// \brief Unique C++ member function declarations based on their
509 /// context+mangled name.
510 DISubprogram getOdrUniqueSubprogram(DIScope Context, DISubprogram SP) const;
513 /// getOrCreateStaticMemberDIE - Create new static data member DIE.
514 DIE *getOrCreateStaticMemberDIE(DIDerivedType DT);
516 /// Look up the source ID with the given directory and source file names. If
517 /// none currently exists, create a new ID and insert it in the line table.
518 virtual unsigned getOrCreateSourceID(StringRef File, StringRef Directory) = 0;
521 /// constructTypeDIE - Construct basic type die from DIBasicType.
522 void constructTypeDIE(DIE &Buffer, DIBasicType BTy);
524 /// constructTypeDIE - Construct derived type die from DIDerivedType.
525 void constructTypeDIE(DIE &Buffer, DIDerivedType DTy);
527 /// constructTypeDIE - Construct type DIE from DICompositeType.
528 void constructTypeDIE(DIE &Buffer, DICompositeType CTy);
530 /// constructSubrangeDIE - Construct subrange DIE from DISubrange.
531 void constructSubrangeDIE(DIE &Buffer, DISubrange SR, DIE *IndexTy);
533 /// constructArrayTypeDIE - Construct array type DIE from DICompositeType.
534 void constructArrayTypeDIE(DIE &Buffer, DICompositeType CTy);
536 /// constructEnumTypeDIE - Construct enum type DIE from DIEnumerator.
537 void constructEnumTypeDIE(DIE &Buffer, DICompositeType CTy);
539 /// constructMemberDIE - Construct member DIE from DIDerivedType.
540 void constructMemberDIE(DIE &Buffer, DIDerivedType DT);
542 /// constructTemplateTypeParameterDIE - Construct new DIE for the given
543 /// DITemplateTypeParameter.
544 void constructTemplateTypeParameterDIE(DIE &Buffer,
545 DITemplateTypeParameter TP);
547 /// constructTemplateValueParameterDIE - Construct new DIE for the given
548 /// DITemplateValueParameter.
549 void constructTemplateValueParameterDIE(DIE &Buffer,
550 DITemplateValueParameter TVP);
552 /// getLowerBoundDefault - Return the default lower bound for an array. If the
553 /// DWARF version doesn't handle the language, return -1.
554 int64_t getDefaultLowerBound() const;
556 /// getDIEEntry - Returns the debug information entry for the specified
558 DIEEntry *getDIEEntry(const MDNode *N) const {
559 return MDNodeToDIEEntryMap.lookup(N);
562 /// insertDIEEntry - Insert debug information entry into the map.
563 void insertDIEEntry(const MDNode *N, DIEEntry *E) {
564 MDNodeToDIEEntryMap.insert(std::make_pair(N, E));
567 // getIndexTyDie - Get an anonymous type for index type.
568 DIE *getIndexTyDie() { return IndexTyDie; }
570 // setIndexTyDie - Set D as anonymous type for index which can be reused
572 void setIndexTyDie(DIE *D) { IndexTyDie = D; }
574 /// createDIEEntry - Creates a new DIEEntry to be a proxy for a debug
575 /// information entry.
576 DIEEntry *createDIEEntry(DIE *Entry);
578 /// resolve - Look in the DwarfDebug map for the MDNode that
579 /// corresponds to the reference.
580 template <typename T> T resolve(DIRef<T> Ref) const {
581 return DD->resolve(Ref);
584 /// If this is a named finished type then include it in the list of types for
585 /// the accelerator tables.
586 void updateAcceleratorTables(DIScope Context, DIType Ty, const DIE *TyDIE);
589 class DwarfCompileUnit : public DwarfUnit {
590 /// The attribute index of DW_AT_stmt_list in the compile unit DIE, avoiding
591 /// the need to search for it in applyStmtList.
592 unsigned stmtListIndex;
595 DwarfCompileUnit(unsigned UID, DIE *D, DICompileUnit Node, AsmPrinter *A,
596 DwarfDebug *DW, DwarfFile *DWU);
598 void initStmtList(MCSymbol *DwarfLineSectionSym);
600 /// Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
601 void applyStmtList(DIE &D);
603 /// createGlobalVariableDIE - create global variable DIE.
604 void createGlobalVariableDIE(DIGlobalVariable GV);
606 /// addLabelAddress - Add a dwarf label attribute data and value using
607 /// either DW_FORM_addr or DW_FORM_GNU_addr_index.
608 void addLabelAddress(DIE *Die, dwarf::Attribute Attribute, MCSymbol *Label);
610 DwarfCompileUnit &getCU() override { return *this; }
612 unsigned getOrCreateSourceID(StringRef FileName, StringRef DirName) override;
615 class DwarfTypeUnit : public DwarfUnit {
617 uint64_t TypeSignature;
619 DwarfCompileUnit &CU;
620 MCDwarfDwoLineTable *SplitLineTable;
623 DwarfTypeUnit(unsigned UID, DIE *D, DwarfCompileUnit &CU, AsmPrinter *A,
624 DwarfDebug *DW, DwarfFile *DWU,
625 MCDwarfDwoLineTable *SplitLineTable = nullptr);
627 void setTypeSignature(uint64_t Signature) { TypeSignature = Signature; }
628 uint64_t getTypeSignature() const { return TypeSignature; }
629 void setType(const DIE *Ty) { this->Ty = Ty; }
631 /// Emit the header for this unit, not including the initial length field.
632 void emitHeader(const MCSection *ASection, const MCSymbol *ASectionSym) const
634 unsigned getHeaderSize() const override {
635 return DwarfUnit::getHeaderSize() + sizeof(uint64_t) + // Type Signature
636 sizeof(uint32_t); // Type DIE Offset
638 void initSection(const MCSection *Section);
639 DwarfCompileUnit &getCU() override { return CU; }
642 unsigned getOrCreateSourceID(StringRef File, StringRef Directory) override;
644 } // end llvm namespace