58 for (
unsigned i = 0,
N = Data.size(); i <
N; ++i)
72 for (
unsigned i = 0,
N = Data.size(); i <
N; ++i) {
99 for (
unsigned i = 0,
N = Data.size(); i <
N; ++i) {
121 assert(Cu &&
"We should not have orphaned DIEs.");
130 if (p->
getTag() == dwarf::DW_TAG_compile_unit ||
131 p->
getTag() == dwarf::DW_TAG_type_unit)
141 for (
const auto &V :
values())
149 const std::string Indent(IndentCount,
' ');
150 bool isBlock =
getTag() == 0;
157 <<
", Size: " <<
Size <<
"\n";
164 O <<
"Size: " <<
Size <<
"\n";
169 for (
const auto &V :
Values) {
175 O <<
"Blk[" << I++ <<
"]";
183 for (
const auto &Child :
children())
184 Child.print(O, IndentCount + 4);
186 if (!isBlock) O <<
"\n";
198 #define HANDLE_DIEVALUE(T) \
200 getDIE##T().EmitValue(AP, Form); \
202 #include "llvm/CodeGen/DIEValue.def"
210 #define HANDLE_DIEVALUE(T) \
212 return getDIE##T().SizeOf(AP, Form);
213 #include "llvm/CodeGen/DIEValue.def"
223 #define HANDLE_DIEVALUE(T) \
225 getDIE##T().print(O); \
227 #include "llvm/CodeGen/DIEValue.def"
299 if (AP->
OutStreamer->getContext().getDwarfVersion() == 2)
301 return sizeof(int32_t);
308 O <<
"Int: " << (int64_t)Integer <<
" 0x";
396 "Expected valid string form");
420 "Expected valid string form");
451 assert(!DD->
useSplitDwarf() &&
"TODO: dwo files can't have relocations.");
456 assert(CU &&
"CUDie should belong to a CU.");
457 Addr += CU->getDebugInfoOffset();
473 assert(DD &&
"Expected Dwarf Debug info to be available");
476 return sizeof(int32_t);
508 for (
const auto &V :
Values)
509 Size += V.SizeOf(AP);
528 for (
const auto &V :
Values)
561 for (
const auto &V :
Values)
562 Size += V.SizeOf(AP);
579 for (
const auto &V :
Values)
DIEAbbrev generateAbbrev() const
Generate the abbreviation for this DIE.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit block data.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit debug information entry offset.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit string value.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void print(raw_ostream &O) const
const DataLayout & getDataLayout() const
Return information about data layout.
void EmitInt8(int Value) const
Emit a byte directive and value.
void print(raw_ostream &O) const
void EmitValue(const AsmPrinter *AP) const
EmitValue - Emit value via the Dwarf writer.
void EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label+Offset" where the size in bytes of the directive is specified by Siz...
void EmitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) const
Emit something like ".long Hi-Lo" where the size in bytes of the directive is specified by Size and H...
Collects and handles dwarf debug information.
const char * AttributeString(unsigned Attribute)
void print(raw_ostream &O) const
void EmitInt32(int Value) const
Emit a long directive and value.
void EmitLabelReference(const MCSymbol *Label, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label" where the size in bytes of the directive is specified by Size and L...
void AddAttribute(dwarf::Attribute Attribute, dwarf::Form Form)
AddAttribute - Adds another set of attribute information to the abbreviation.
void print(raw_ostream &O, unsigned IndentCount=0) const
void Profile(FoldingSetNodeID &ID) const
Profile - Used to gather unique data for the abbreviation folding set.
DIEAbbrevData - Dwarf abbreviation data, describes one attribute of a Dwarf abbreviation.
void print(raw_ostream &O) const
dwarf::Form getForm() const
const char * TagString(unsigned Tag)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned Offset
Offset - Offset in debug info section.
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
SizeOf - Determine size of delta value in bytes.
void AddInteger(signed I)
const List & getList(size_t LI) const
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit location data.
static unsigned getRefAddrSize(const AsmPrinter *AP)
Returns size of a ref_addr entry.
void print(raw_ostream &O) const
raw_ostream & write_hex(unsigned long long N)
Output N in hexadecimal, without any prefix or padding.
void emitDwarfSymbolReference(const MCSymbol *Label, bool ForceOffset=false) const
Emit a reference to a symbol for use in dwarf.
void EmitInt16(int Value) const
Emit a short directive and value.
unsigned getIndex() const
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit expression value.
unsigned Size
Size - Size of instance + children.
dwarf::Tag getTag() const
void print(raw_ostream &O) const
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
SizeOf - Determine size of label value in bytes.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support...
const MCAsmInfo * MAI
Target Asm Printer information.
const DIE * getUnitOrNull() const
Similar to getUnit, returns null when DIE is not added to an owner yet.
DIEValue findAttribute(dwarf::Attribute Attribute) const
Find a value in the DIE with the attribute given.
void EmitULEB128(uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
Emit the specified unsigned leb128 value.
DIE - A structured debug information entry.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit delta value.
This class is intended to be used as a driving class for all asm writers.
void print(raw_ostream &O) const
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
SizeOf - Determine size of integer value in bytes.
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
SizeOf - Determine size of block data in bytes.
DwarfDebug * getDwarfDebug()
DIEValueList Values
Attribute values.
unsigned getOffset() const
void print(raw_ostream &O) const
unsigned getULEB128Size(uint64_t Value)
Utility function to get the size of the ULEB128-encoded value.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
dwarf::Attribute getAttribute() const
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
SizeOf - Determine size of expression value in bytes.
const DebugLocStream & getDebugLocs() const
Returns the entries for the .debug_loc section.
unsigned getOffset() const
DwarfCompileUnit * lookupUnit(const DIE *CU) const
Find the DwarfCompileUnit for the given CU Die.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
StringRef getString() const
void print(raw_ostream &O) const
void Profile(FoldingSetNodeID &ID) const
Profile - Used to gather unique data for the abbreviation folding set.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
unsigned SizeOf(const AsmPrinter *AP) const
SizeOf - Return the size of a value in bytes.
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
SizeOf - Determine size of location data in bytes.
DIEInteger - An integer value DIE.
DIEAbbrev - Dwarf abbreviation, describes the organization of a debug information object...
StringRef getName() const
getName - Get the symbol name.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit integer of appropriate size.
void EmitSLEB128(int64_t Value, const char *Desc=nullptr) const
Emit the specified signed leb128 value.
void print(raw_ostream &O) const
dwarf::Tag Tag
Tag - Dwarf tag code.
void print(raw_ostream &O)
const char * FormEncodingString(unsigned Encoding)
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
unsigned getSLEB128Size(int64_t Value)
Utility function to get the size of the SLEB128-encoded value.
void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
unsigned ComputeSize(const AsmPrinter *AP) const
ComputeSize - Calculate the size of the location expression.
const char * ChildrenString(unsigned Children)
MCSymbol * getSymbol() const
This class implements an extremely fast bulk output stream that can only output to a stream...
unsigned ComputeSize(const AsmPrinter *AP) const
ComputeSize - Calculate the size of the location expression.
void Emit(const AsmPrinter *AP) const
Emit - Print the abbreviation using the specified asm printer.
const DIE * getUnit() const
Climb up the parent chain to get the compile or type unit DIE this DIE belongs to.
uint64_t getTypeSignature() const
unsigned getPointerSize(unsigned AS=0) const
Layout pointer size FIXME: The defaults need to be removed once all of the backends/clients are updat...
unsigned getDwarfVersion() const
Returns the Dwarf Version.
void print(raw_ostream &O) const
bool doesDwarfUseRelocationsAcrossSections() const
unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const
SizeOf - Determine size of delta value in bytes.