9#ifndef LLVM_DEBUGINFO_DWARF_DWARFDIE_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDIE_H
74 return AbbrevDecl->getTag();
75 return dwarf::DW_TAG_null;
165 std::optional<DWARFFormValue>
241 std::string *OriginalFullName =
nullptr)
const;
275 class attribute_iterator;
291 iterator
begin()
const;
292 iterator
end()
const;
294 std::reverse_iterator<iterator>
rbegin()
const;
295 std::reverse_iterator<iterator>
rend()
const;
302 const DWARFAttribute> {
332 return LHS.Index ==
RHS.Index;
341 return LHS.getDebugInfoEntry() ==
RHS.getDebugInfoEntry() &&
342 LHS.getDwarfUnit() ==
RHS.getDwarfUnit();
350 return LHS.getOffset() <
RHS.getOffset();
358 friend std::reverse_iterator<llvm::DWARFDie::iterator>;
382 return LHS.Die ==
RHS.Die;
404class reverse_iterator<
llvm::DWARFDie::iterator>
406 reverse_iterator<llvm::DWARFDie::iterator>,
407 bidirectional_iterator_tag, const llvm::DWARFDie> {
415 : Die(It.Die), AtEnd(!It.Die.getPreviousSibling()) {
425 assert(!AtEnd &&
"Incrementing rend");
452 bool equals(
const reverse_iterator<llvm::DWARFDie::iterator> &
RHS)
const {
453 return Die ==
RHS.Die && AtEnd ==
RHS.AtEnd;
462 const std::reverse_iterator<DWARFDie::iterator> &
RHS) {
467 const std::reverse_iterator<DWARFDie::iterator> &
RHS) {
472 return std::make_reverse_iterator(
end());
476 return std::make_reverse_iterator(
begin());
481 std::string *OriginalFullName =
nullptr);
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file contains constants used for implementing Dwarf debug support.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
A structured debug information entry.
DWARFDebugInfoEntry - A DIE with only the minimum required data.
uint64_t getOffset() const
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
const DWARFAttribute & operator*() const
attribute_iterator & operator++()
attribute_iterator()=delete
friend bool operator==(const attribute_iterator &LHS, const attribute_iterator &RHS)
attribute_iterator & operator--()
friend bool operator==(const DWARFDie::iterator &LHS, const DWARFDie::iterator &RHS)
const DWARFDie & operator*() const
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
void getFullName(raw_string_ostream &, std::string *OriginalFullName=nullptr) const
DWARFDie resolveTypeUnitReference() const
std::optional< uint64_t > getLocBaseAttribute() const
uint64_t getOffset() const
Get the absolute offset into the debug info or types section.
const char * getShortName() const
Return the DIE short name resolving DW_AT_specification or DW_AT_abstract_origin references if necess...
DWARFDie(DWARFUnit *Unit, const DWARFDebugInfoEntry *D)
Expected< DWARFAddressRangesVector > getAddressRanges() const
Get the address ranges for this DIE.
iterator_range< iterator > children() const
std::reverse_iterator< iterator > rbegin() const
DWARFDie getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE as the referenced DIE.
DWARFDie getParent() const
Get the parent of this DIE object.
std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
DWARFUnit * getDwarfUnit() const
const DWARFDebugInfoEntry * getDebugInfoEntry() const
const char * getSubroutineName(DINameKind Kind) const
If a DIE represents a subprogram (or inlined subroutine), returns its mangled name (or short name,...
DWARFDie getSibling() const
Get the sibling of this DIE object.
bool isSubroutineDIE() const
Returns true if DIE represents a subprogram or an inlined subroutine.
bool getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC, uint64_t &SectionIndex) const
Retrieves DW_AT_low_pc and DW_AT_high_pc from CU.
LLVM_DUMP_METHOD void dump() const
Convenience zero-argument overload for debugging.
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...
bool isSubprogramDIE() const
Returns true if DIE represents a subprogram (not inlined).
bool addressRangeContainsAddress(const uint64_t Address) const
std::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...
std::optional< uint64_t > getHighPC(uint64_t LowPC) const
Get the DW_AT_high_pc attribute value as an address.
std::optional< uint64_t > getTypeSize(uint64_t PointerSize)
Gets the type size (in bytes) for this DIE.
const char * getName(DINameKind Kind) const
Return the DIE name resolving DW_AT_specification or DW_AT_abstract_origin references if necessary.
DWARFDie getLastChild() const
Get the last child of this DIE object.
DWARFDie getPreviousSibling() const
Get the previous sibling of this DIE object.
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Get the abbreviation declaration for this DIE.
std::string getDeclFile(DILineInfoSpecifier::FileLineInfoKind Kind) const
DWARFDie getFirstChild() const
Get the first child of this DIE object.
uint64_t getDeclLine() const
Returns the declaration line (start line) for a DIE, assuming it specifies a subprogram.
dwarf::Tag getTag() const
const char * getLinkageName() const
Return the DIE linkage name resolving DW_AT_specification or DW_AT_abstract_origin references if nece...
Expected< DWARFLocationExpressionsVector > getLocations(dwarf::Attribute Attr) const
std::optional< uint64_t > getRangesBaseAttribute() const
Extract the range base attribute from this DIE as absolute section offset.
bool isNULL() const
Returns true for a valid DIE that terminates a sibling chain.
iterator_range< attribute_iterator > attributes() const
Get an iterator range to all attributes in the current DIE only.
std::reverse_iterator< iterator > rend() const
Tagged union holding either a T or a Error.
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
reverse_iterator< llvm::DWARFDie::iterator > & operator++()
const llvm::DWARFDie & operator*() const
bool equals(const reverse_iterator< llvm::DWARFDie::iterator > &RHS) const
llvm::DWARFDie::iterator base() const
reverse_iterator< llvm::DWARFDie::iterator > & operator--()
reverse_iterator(llvm::DWARFDie::iterator It)
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
This is an optimization pass for GlobalISel generic memory operations.
bool operator<(int64_t V1, const APSInt &V2)
bool operator!=(uint64_t V1, const APInt &V2)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS)
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS, std::string *OriginalFullName=nullptr)
Implement std::hash so that hash_code can be used in STL containers.
Container for dump options that control which debug information will be dumped.
Encapsulates a DWARF attribute value and all of the data required to describe the attribute value.