Go to the documentation of this file.
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDIE_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFDIE_H
52 explicit operator bool()
const {
return isValid(); }
75 return AbbrevDecl->getTag();
76 return dwarf::DW_TAG_null;
242 std::string *OriginalFullName =
nullptr)
const;
276 class attribute_iterator;
292 iterator
begin()
const;
293 iterator
end()
const;
295 std::reverse_iterator<iterator>
rbegin()
const;
296 std::reverse_iterator<iterator>
rend()
const;
303 const DWARFAttribute> {
327 explicit operator bool()
const {
return AttrValue.
isValid(); }
333 return LHS.Index ==
RHS.Index;
342 return LHS.getDebugInfoEntry() ==
RHS.getDebugInfoEntry() &&
343 LHS.getDwarfUnit() ==
RHS.getDwarfUnit();
351 return LHS.getOffset() <
RHS.getOffset();
383 return LHS.Die ==
RHS.Die;
405 class reverse_iterator<
llvm::DWARFDie::iterator>
407 reverse_iterator<llvm::DWARFDie::iterator>,
408 bidirectional_iterator_tag, const llvm::DWARFDie> {
416 : Die(It.Die), AtEnd(!It.Die.getPreviousSibling()) {
426 assert(!AtEnd &&
"Incrementing rend");
454 return Die ==
RHS.Die && AtEnd ==
RHS.AtEnd;
462 inline bool operator==(
const std::reverse_iterator<DWARFDie::iterator> &
LHS,
463 const std::reverse_iterator<DWARFDie::iterator> &
RHS) {
467 inline bool operator!=(
const std::reverse_iterator<DWARFDie::iterator> &
LHS,
468 const std::reverse_iterator<DWARFDie::iterator> &
RHS) {
473 return std::make_reverse_iterator(
end());
477 return std::make_reverse_iterator(
begin());
482 std::string *OriginalFullName =
nullptr);
486 #endif // LLVM_DEBUGINFO_DWARF_DWARFDIE_H
std::reverse_iterator< iterator > rend() const
DWARFDie(DWARFUnit *Unit, const DWARFDebugInfoEntry *D)
const llvm::DWARFDie & operator*() const
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This is an optimization pass for GlobalISel generic memory operations.
DWARFDie getPreviousSibling() const
Get the previous sibling of this DIE object.
Optional< uint64_t > getRangesBaseAttribute() const
Extract the range base attribute from this DIE as absolute section offset.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
const char * getLinkageName() const
Return the DIE linkage name resolving DW_AT_specification or DW_AT_abstract_origin references if nece...
LLVM_DUMP_METHOD void dump() const
Convenience zero-argument overload for debugging.
DWARFDie resolveTypeUnitReference() const
A raw_ostream that writes to an std::string.
const char * getShortName() const
Return the DIE short name resolving DW_AT_specification or DW_AT_abstract_origin references if necess...
std::reverse_iterator< iterator > rbegin() const
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Get the abbreviation declaration for this DIE.
friend bool operator==(const attribute_iterator &LHS, const attribute_iterator &RHS)
bool operator!=(uint64_t V1, const APInt &V2)
friend bool operator==(const DWARFDie::iterator &LHS, const DWARFDie::iterator &RHS)
bool addressRangeContainsAddress(const uint64_t Address) const
A structured debug information entry.
Tagged union holding either a T or a Error.
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
DWARFDebugInfoEntry - A DIE with only the minimum required data.
const DWARFDebugInfoEntry * getDebugInfoEntry() const
bool isNULL() const
Returns true for a valid DIE that terminates a sibling chain.
iterator_range< iterator > children() const
reverse_iterator< llvm::DWARFDie::iterator > & operator++()
DWARFDie getLastChild() const
Get the last child of this DIE object.
Encapsulates a DWARF attribute value and all of the data required to describe the attribute value.
reverse_iterator(llvm::DWARFDie::iterator It)
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
bool isSubroutineDIE() const
Returns true if DIE represents a subprogram or an inlined subroutine.
void getCallerFrame(uint32_t &CallFile, uint32_t &CallLine, uint32_t &CallColumn, uint32_t &CallDiscriminator) const
Retrieves values of DW_AT_call_file, DW_AT_call_line and DW_AT_call_column from DIE (or zeroes if the...
std::string getDeclFile(DILineInfoSpecifier::FileLineInfoKind Kind) const
This class implements an extremely fast bulk output stream that can only output to a stream.
reverse_iterator< llvm::DWARFDie::iterator > & operator--()
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
uint64_t getDeclLine() const
Returns the declaration line (start line) for a DIE, assuming it specifies a subprogram.
Expected< DWARFAddressRangesVector > getAddressRanges() const
Get the address ranges for this DIE.
void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS, std::string *OriginalFullName=nullptr)
bool operator<(int64_t V1, const APSInt &V2)
uint64_t getOffset() const
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
uint64_t getOffset() const
Get the absolute offset into the debug info or types section.
const DWARFAttribute & operator*() const
constexpr uint64_t PointerSize
x86_64 pointer size.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool operator==(uint64_t V1, const APInt &V2)
Optional< DWARFFormValue > findRecursively(ArrayRef< dwarf::Attribute > Attrs) const
Extract the first value of any attribute in Attrs from this DIE and recurse into any DW_AT_specificat...
bool getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC, uint64_t &SectionIndex) const
Retrieves DW_AT_low_pc and DW_AT_high_pc from CU.
Expected< DWARFLocationExpressionsVector > getLocations(dwarf::Attribute Attr) const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
llvm::DWARFDie::iterator base() const
DWARFUnit * getDwarfUnit() const
const char * getName(DINameKind Kind) const
Return the DIE name resolving DW_AT_specification or DW_AT_abstract_origin references if necessary.
Optional< uint64_t > getLocBaseAttribute() const
DWARFDie getSibling() const
Get the sibling of this DIE object.
attribute_iterator & operator++()
DWARFDie getParent() const
Get the parent of this DIE object.
void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS)
const DWARFDie & operator*() const
void getFullName(raw_string_ostream &, std::string *OriginalFullName=nullptr) const
bool equals(const reverse_iterator< llvm::DWARFDie::iterator > &RHS) const
DWARFDie getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE as the referenced DIE.
dwarf::Tag getTag() const
iterator_range< attribute_iterator > attributes() const
Get an iterator range to all attributes in the current DIE only.
Optional< uint64_t > getTypeSize(uint64_t PointerSize)
Gets the type size (in bytes) for this DIE.
A range adaptor for a pair of iterators.
attribute_iterator()=delete
attribute_iterator & operator--()
Optional< uint64_t > getHighPC(uint64_t LowPC) const
Get the DW_AT_high_pc attribute value as an address.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
bool isSubprogramDIE() const
Returns true if DIE represents a subprogram (not inlined).
DWARFDie getFirstChild() const
Get the first child of this DIE object.
const char * getSubroutineName(DINameKind Kind) const
If a DIE represents a subprogram (or inlined subroutine), returns its mangled name (or short name,...
Container for dump options that control which debug information will be dumped.