Go to the documentation of this file.
21 :
Asm(AP), Abbrevs(AbbrevAllocator), StrPool(
DA, *
Asm, Pref) {}
30 for (
const auto &TheU : CUs)
63 for (
const auto &TheU : CUs) {
64 if (TheU->getCUNode()->isDebugDirectivesOnly())
72 TheU->setDebugSectionOffset(SecOffset);
75 if (SecOffset > UINT32_MAX && !Asm->
isDwarf64())
77 "for the 32-bit DWARF format.");
101 bool UseRelativeOffsets) {
102 StrPool.
emit(*Asm, StrSection, OffsetSection, UseRelativeOffsets);
106 auto &ScopeVars = ScopeVariables[
LS];
108 if (
unsigned ArgNum = DV->
getArg()) {
109 auto Cached = ScopeVars.Args.find(ArgNum);
110 if (Cached == ScopeVars.Args.end())
111 ScopeVars.Args[ArgNum] = Var;
117 ScopeVars.Locals.push_back(Var);
127 std::pair<uint32_t, RangeSpanList *>
129 CURangeLists.push_back(
131 return std::make_pair(CURangeLists.size() - 1, &CURangeLists.back());
This is an optimization pass for GlobalISel generic memory operations.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
virtual void emitHeader(bool UseOffsets)=0
Emit the header for this unit, not including the initial length field.
MCSymbol * createTempSymbol(const Twine &Name) const
DwarfFile(AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
LexicalScope - This class is used to track scope information.
MCSymbol * getEndLabel() const
bool addScopeVariable(LexicalScope *LS, DbgVariable *Var)
A structured debug information entry.
This class is used to track label information.
unsigned computeOffsetsAndAbbrevs(const dwarf::FormParams &FormParams, DIEAbbrevSet &AbbrevSet, unsigned CUOffset)
Compute the offset of this DIE and all its children.
unsigned computeSizeAndOffset(DIE &Die, unsigned Offset)
Compute the size and offset of a DIE given an incoming Offset.
void emitUnit(DwarfUnit *TheU, bool UseOffsets)
Emit the given unit to its section.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
const DICompileUnit * getCUNode() const
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
std::pair< uint32_t, RangeSpanList * > addRange(const DwarfCompileUnit &CU, SmallVector< RangeSpan, 2 > R)
void emitStrings(MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
Emit all of the strings to the section given.
void Emit(const AsmPrinter *AP, MCSection *Section) const
Print all abbreviations using the specified asm printer.
This class is used to track local variable information.
Allocate memory in an ever growing pool, as if by bump-pointer.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
MCSection * getSection() const
Return the section that this DIEUnit will be emitted into.
bool isDebugDirectivesOnly() const
unsigned computeSizeAndOffsetsForUnit(DwarfUnit *TheU)
Compute the size and offset of all the DIEs in the given unit.
void addScopeLabel(LexicalScope *LS, DbgLabel *Label)
StringRef - Represent a constant reference to a string, i.e.
void emit(AsmPrinter &Asm, MCSection *StrSection, MCSection *OffsetSection=nullptr, bool UseRelativeOffsets=false)
Instances of this class represent a uniqued identifier for a section in the current translation unit.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
unsigned int getUnitLengthFieldByteSize() const
Returns 4 for DWARF32 and 12 for DWARF64.
void addUnit(std::unique_ptr< DwarfCompileUnit > U)
Add a unit to the list of CUs.
void computeSizeAndOffsets()
Compute the size and offset of all the DIEs.
constexpr bool empty(const T &RangeOrContainer)
Test whether RangeOrContainer is empty. Similar to C++17 std::empty.
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.
const DILocalVariable * getVariable() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void emitDwarfDIE(const DIE &Die) const
Recursively emit Dwarf DIE tree.
This dwarf writer support class manages information associated with a source file.
void emitAbbrevs(MCSection *)
Emit a set of abbreviations to the specific section.
void addMMIEntry(const DbgVariable &V)
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
dwarf::FormParams getDwarfFormParams() const
Returns information about the byte size of DW_FORM values.