25 :
Asm(AP), Abbrevs(AbbrevAllocator), StrPool(DA, *
Asm, Pref) {}
28 CUs.push_back(std::move(U));
34 for (
const auto &TheU : CUs)
58 unsigned SecOffset = 0;
62 for (
const auto &TheU : CUs) {
63 if (TheU->getCUNode()->isDebugDirectivesOnly())
66 TheU->setDebugSectionOffset(SecOffset);
73 unsigned Offset =
sizeof(int32_t) +
91 bool UseRelativeOffsets) {
92 StrPool.
emit(*Asm, StrSection, OffsetSection, UseRelativeOffsets);
96 auto &ScopeVars = ScopeVariables[
LS];
98 if (
unsigned ArgNum = DV->
getArg()) {
99 auto Cached = ScopeVars.Args.find(ArgNum);
100 if (Cached == ScopeVars.Args.end())
101 ScopeVars.Args[ArgNum] = Var;
107 ScopeVars.Locals.push_back(Var);
117 std::pair<uint32_t, RangeSpanList *>
119 CURangeLists.push_back(
121 return std::make_pair(CURangeLists.size() - 1, &CURangeLists.back());
const DICompileUnit * getCUNode() const
Instances of this class represent a uniqued identifier for a section in the current translation unit...
void addUnit(std::unique_ptr< DwarfCompileUnit > U)
Add a unit to the list of CUs.
void addMMIEntry(const DbgVariable &V)
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
unsigned computeSizeAndOffset(DIE &Die, unsigned Offset)
Compute the size and offset of a DIE given an incoming Offset.
void push_back(const T &Elt)
void emit(AsmPrinter &Asm, MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
LexicalScope - This class is used to track scope information.
std::pair< uint32_t, RangeSpanList * > addRange(const DwarfCompileUnit &CU, SmallVector< RangeSpan, 2 > R)
void emitDwarfDIE(const DIE &Die) const
Recursively emit Dwarf DIE tree.
bool isDebugDirectivesOnly() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
virtual void emitHeader(bool UseOffsets)=0
Emit the header for this unit, not including the initial length field.
This class is used to track local variable information.
const DILocalVariable * getVariable() const
This class is used to track label information.
unsigned computeSizeAndOffsetsForUnit(DwarfUnit *TheU)
Compute the size and offset of all the DIEs in the given unit.
This dwarf writer support class manages information associated with a source file.
void emitUnit(DwarfUnit *U, bool UseOffsets)
Emit the given unit to its section.
Allocate memory in an ever growing pool, as if by bump-pointer.
A structured debug information entry.
This class is intended to be used as a driving class for all asm writers.
void computeSizeAndOffsets()
Compute the size and offset of all the DIEs.
bool addScopeVariable(LexicalScope *LS, DbgVariable *Var)
DwarfFile(AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA)
unsigned computeOffsetsAndAbbrevs(const AsmPrinter *AP, DIEAbbrevSet &AbbrevSet, unsigned CUOffset)
Compute the offset of this DIE and all its children.
void addScopeLabel(LexicalScope *LS, DbgLabel *Label)
MCSection * getSection() const
Return the section that this DIEUnit will be emitted into.
MCSymbol * getEndLabel() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void emitStrings(MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
Emit all of the strings to the section given.
void emitAbbrevs(MCSection *)
Emit a set of abbreviations to the specific section.
StringRef - Represent a constant reference to a string, i.e.
void Emit(const AsmPrinter *AP, MCSection *Section) const
Print all abbreviations using the specified asm printer.
void emitUnits(bool UseOffsets)
Emit all of the units to the section listed with the given abbreviation section.
MCSymbol * createTempSymbol(const Twine &Name) const