21 :
Asm(AP), StrPool(DA, *
Asm, Pref) {}
37 AbbreviationsSet.FindNodeOrInsertPos(ID, InsertPos)) {
44 Abbreviations.push_back(New);
49 AbbreviationsSet.InsertNode(New, InsertPos);
54 CUs.push_back(std::move(U));
60 for (
const auto &TheU : CUs) {
61 DIE &Die = TheU->getUnitDie();
65 TheU->emitHeader(UseOffsets);
74 unsigned SecOffset = 0;
78 for (
const auto &TheU : CUs) {
79 TheU->setDebugInfoOffset(SecOffset);
82 unsigned Offset =
sizeof(int32_t) +
83 TheU->getHeaderSize();
88 SecOffset += EndOffset;
104 for (
const auto &V : Die.
values())
106 Offset += V.SizeOf(Asm);
111 assert(Abbrev.
hasChildren() &&
"Children flag not set");
117 Offset +=
sizeof(int8_t);
126 if (!Abbreviations.empty()) {
135 StrPool.
emit(*Asm, StrSection, OffsetSection);
142 if (
unsigned ArgNum = DV->
getArg()) {
151 while (
I != Vars.
end()) {
152 unsigned CurNum = (*I)->getVariable()->getArg();
160 if (CurNum == ArgNum) {
161 (*I)->addMMIEntry(*Var);
DIEAbbrev generateAbbrev() const
Generate the abbreviation for this DIE.
Instances of this class represent a uniqued identifier for a section in the current translation unit...
void push_back(const T &Elt)
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
DwarfFile(AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA)
LexicalScope - This class is used to track scope information.
void Profile(FoldingSetNodeID &ID) const
Profile - Used to gather unique data for the abbreviation folding set.
void emitDwarfDIE(const DIE &Die) const
Recursively emit Dwarf DIE tree.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void setNumber(unsigned N)
This class is used to track local variable information.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Allocate memory in an ever growing pool, as if by bump-pointer.
unsigned getAbbrevNumber() const
DIE - A structured debug information entry.
This class is intended to be used as a driving class for all asm writers.
void emitUnits(bool UseOffsets)
Emit all of the units to the section listed with the given abbreviation section.
void emitDwarfAbbrevs(const std::vector< DIEAbbrev * > &Abbrevs) const
Emit Dwarf abbreviation table.
unsigned getULEB128Size(uint64_t Value)
Utility function to get the size of the ULEB128-encoded value.
DIEAbbrev & assignAbbrevNumber(DIE &Die)
Define a unique number for the abbreviation.
void computeSizeAndOffsets()
Compute the size and offset of all the DIEs.
unsigned getOffset() const
const DILocalVariable * getVariable() const
void emitAbbrevs(MCSection *)
Emit a set of abbreviations to the specific section.
iterator insert(iterator I, T &&Elt)
bool addScopeVariable(LexicalScope *LS, DbgVariable *Var)
DIEAbbrev - Dwarf abbreviation, describes the organization of a debug information object...
void setOffset(unsigned O)
unsigned computeSizeAndOffset(DIE &Die, unsigned Offset)
Compute the size and offset of a DIE given an incoming Offset.
void emitStrings(MCSection *StrSection, MCSection *OffsetSection=nullptr)
Emit all of the strings to the section given.
void emit(AsmPrinter &Asm, MCSection *StrSection, MCSection *OffsetSection=nullptr)
void setAbbrevNumber(unsigned I)
Set the abbreviation number for this DIE.
void addUnit(std::unique_ptr< DwarfUnit > U)
Add a unit to the list of CUs.
StringRef - Represent a constant reference to a string, i.e.