LLVM 22.0.0git
DWARFDie.h
Go to the documentation of this file.
1//===- DWARFDie.h -----------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_DWARF_DWARFDIE_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDIE_H
11
12#include "llvm/ADT/ArrayRef.h"
13#include "llvm/ADT/iterator.h"
22#include <cassert>
23#include <cstdint>
24#include <iterator>
25
26namespace llvm {
27
28class DWARFUnit;
29class raw_ostream;
30
31//===----------------------------------------------------------------------===//
32/// Utility class that carries the DWARF compile/type unit and the debug info
33/// entry in an object.
34///
35/// When accessing information from a debug info entry we always need to DWARF
36/// compile/type unit in order to extract the info correctly as some information
37/// is relative to the compile/type unit. Prior to this class the DWARFUnit and
38/// the DWARFDebugInfoEntry was passed around separately and there was the
39/// possibility for error if the wrong DWARFUnit was used to extract a unit
40/// relative offset. This class helps to ensure that this doesn't happen and
41/// also simplifies the attribute extraction calls by not having to specify the
42/// DWARFUnit for each call.
43class DWARFDie {
44 DWARFUnit *U = nullptr;
45 const DWARFDebugInfoEntry *Die = nullptr;
46
47public:
49 DWARFDie() = default;
50 DWARFDie(DWARFUnit *Unit, const DWARFDebugInfoEntry *D) : U(Unit), Die(D) {}
51
52 bool isValid() const { return U && Die; }
53 explicit operator bool() const { return isValid(); }
54 const DWARFDebugInfoEntry *getDebugInfoEntry() const { return Die; }
55 DWARFUnit *getDwarfUnit() const { return U; }
56
57 /// Get the abbreviation declaration for this DIE.
58 ///
59 /// \returns the abbreviation declaration or NULL for null tags.
61 assert(isValid() && "must check validity prior to calling");
63 }
64
65 /// Get the absolute offset into the debug info or types section.
66 ///
67 /// \returns the DIE offset or -1U if invalid.
69 assert(isValid() && "must check validity prior to calling");
70 return Die->getOffset();
71 }
72
74 auto AbbrevDecl = getAbbreviationDeclarationPtr();
75 if (AbbrevDecl)
76 return AbbrevDecl->getTag();
77 return dwarf::DW_TAG_null;
78 }
79
80 bool hasChildren() const {
81 assert(isValid() && "must check validity prior to calling");
82 return Die->hasChildren();
83 }
84
85 /// Returns true for a valid DIE that terminates a sibling chain.
86 bool isNULL() const { return getAbbreviationDeclarationPtr() == nullptr; }
87
88 /// Returns true if DIE represents a subprogram (not inlined).
89 LLVM_ABI bool isSubprogramDIE() const;
90
91 /// Returns true if DIE represents a subprogram or an inlined subroutine.
92 LLVM_ABI bool isSubroutineDIE() const;
93
94 /// Get the parent of this DIE object.
95 ///
96 /// \returns a valid DWARFDie instance if this object has a parent or an
97 /// invalid DWARFDie instance if it doesn't.
99
100 /// Get the sibling of this DIE object.
101 ///
102 /// \returns a valid DWARFDie instance if this object has a sibling or an
103 /// invalid DWARFDie instance if it doesn't.
105
106 /// Get the previous sibling of this DIE object.
107 ///
108 /// \returns a valid DWARFDie instance if this object has a sibling or an
109 /// invalid DWARFDie instance if it doesn't.
111
112 /// Get the first child of this DIE object.
113 ///
114 /// \returns a valid DWARFDie instance if this object has children or an
115 /// invalid DWARFDie instance if it doesn't.
117
118 /// Get the last child of this DIE object.
119 ///
120 /// \returns a valid null DWARFDie instance if this object has children or an
121 /// invalid DWARFDie instance if it doesn't.
123
124 /// Dump the DIE and all of its attributes to the supplied stream.
125 ///
126 /// \param OS the stream to use for output.
127 /// \param indent the number of characters to indent each line that is output.
128 LLVM_ABI void dump(raw_ostream &OS, unsigned indent = 0,
129 DIDumpOptions DumpOpts = DIDumpOptions()) const;
130
131 /// Convenience zero-argument overload for debugging.
132 LLVM_ABI LLVM_DUMP_METHOD void dump() const;
133
134 /// Extract the specified attribute from this DIE.
135 ///
136 /// Extract an attribute value from this DIE only. This call doesn't look
137 /// for the attribute value in any DW_AT_specification or
138 /// DW_AT_abstract_origin referenced DIEs.
139 ///
140 /// \param Attr the attribute to extract.
141 /// \returns an optional DWARFFormValue that will have the form value if the
142 /// attribute was successfully extracted.
143 LLVM_ABI std::optional<DWARFFormValue> find(dwarf::Attribute Attr) const;
144
145 /// Extract the first value of any attribute in Attrs from this DIE.
146 ///
147 /// Extract the first attribute that matches from this DIE only. This call
148 /// doesn't look for the attribute value in any DW_AT_specification or
149 /// DW_AT_abstract_origin referenced DIEs. The attributes will be searched
150 /// linearly in the order they are specified within Attrs.
151 ///
152 /// \param Attrs an array of DWARF attribute to look for.
153 /// \returns an optional that has a valid DWARFFormValue for the first
154 /// matching attribute in Attrs, or std::nullopt if none of the attributes in
155 /// Attrs exist in this DIE.
156 LLVM_ABI std::optional<DWARFFormValue>
157 find(ArrayRef<dwarf::Attribute> Attrs) const;
158
159 /// Extract the first value of any attribute in Attrs from this DIE and
160 /// recurse into any DW_AT_specification or DW_AT_abstract_origin referenced
161 /// DIEs.
162 ///
163 /// \param Attrs an array of DWARF attribute to look for.
164 /// \returns an optional that has a valid DWARFFormValue for the first
165 /// matching attribute in Attrs, or std::nullopt if none of the attributes in
166 /// Attrs exist in this DIE or in any DW_AT_specification or
167 /// DW_AT_abstract_origin DIEs.
168 LLVM_ABI std::optional<DWARFFormValue>
170
171 /// Extract the specified attribute from this DIE as the referenced DIE.
172 ///
173 /// Regardless of the reference type, return the correct DWARFDie instance if
174 /// the attribute exists. The returned DWARFDie object might be from another
175 /// DWARFUnit, but that is all encapsulated in the new DWARFDie object.
176 ///
177 /// Extract an attribute value from this DIE only. This call doesn't look
178 /// for the attribute value in any DW_AT_specification or
179 /// DW_AT_abstract_origin referenced DIEs.
180 ///
181 /// \param Attr the attribute to extract.
182 /// \returns a valid DWARFDie instance if the attribute exists, or an invalid
183 /// DWARFDie object if it doesn't.
188
190
193 /// Extract the range base attribute from this DIE as absolute section offset.
194 ///
195 /// This is a utility function that checks for either the DW_AT_rnglists_base
196 /// or DW_AT_GNU_ranges_base attribute.
197 ///
198 /// \returns anm optional absolute section offset value for the attribute.
199 LLVM_ABI std::optional<uint64_t> getRangesBaseAttribute() const;
200 LLVM_ABI std::optional<uint64_t> getLocBaseAttribute() const;
201
202 /// Get the DW_AT_high_pc attribute value as an address.
203 ///
204 /// In DWARF version 4 and later the high PC can be encoded as an offset from
205 /// the DW_AT_low_pc. This function takes care of extracting the value as an
206 /// address or offset and adds it to the low PC if needed and returns the
207 /// value as an optional in case the DIE doesn't have a DW_AT_high_pc
208 /// attribute.
209 ///
210 /// \param LowPC the low PC that might be needed to calculate the high PC.
211 /// \returns an optional address value for the attribute.
212 LLVM_ABI std::optional<uint64_t> getHighPC(uint64_t LowPC) const;
213
214 /// Retrieves DW_AT_low_pc and DW_AT_high_pc from CU.
215 /// Returns true if both attributes are present.
216 LLVM_ABI bool getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC,
217 uint64_t &SectionIndex) const;
218
219 /// Get the address ranges for this DIE.
220 ///
221 /// Get the hi/low PC range if both attributes are available or exrtracts the
222 /// non-contiguous address ranges from the DW_AT_ranges attribute.
223 ///
224 /// Extracts the range information from this DIE only. This call doesn't look
225 /// for the range in any DW_AT_specification or DW_AT_abstract_origin DIEs.
226 ///
227 /// \returns a address range vector that might be empty if no address range
228 /// information is available.
230
232
233 LLVM_ABI std::optional<uint64_t> getLanguage() const;
234
236 getLocations(dwarf::Attribute Attr) const;
237
238 /// If a DIE represents a subprogram (or inlined subroutine), returns its
239 /// mangled name (or short name, if mangled is missing). This name may be
240 /// fetched from specification or abstract origin for this subprogram.
241 /// Returns null if no name is found.
242 LLVM_ABI const char *getSubroutineName(DINameKind Kind) const;
243
244 /// Return the DIE name resolving DW_AT_specification or DW_AT_abstract_origin
245 /// references if necessary. For the LinkageName case it additionaly searches
246 /// for ShortName if LinkageName is not found.
247 /// Returns null if no name is found.
248 LLVM_ABI const char *getName(DINameKind Kind) const;
250 std::string *OriginalFullName = nullptr) const;
251
252 /// Return the DIE short name resolving DW_AT_specification or
253 /// DW_AT_abstract_origin references if necessary. Returns null if no name
254 /// is found.
255 LLVM_ABI const char *getShortName() const;
256
257 /// Return the DIE linkage name resolving DW_AT_specification or
258 /// DW_AT_abstract_origin references if necessary. Returns null if no name
259 /// is found.
260 LLVM_ABI const char *getLinkageName() const;
261
262 /// Returns the declaration line (start line) for a DIE, assuming it specifies
263 /// a subprogram. This may be fetched from specification or abstract origin
264 /// for this subprogram by resolving DW_AT_sepcification or
265 /// DW_AT_abstract_origin references if necessary.
267 LLVM_ABI std::string
269
270 /// Retrieves values of DW_AT_call_file, DW_AT_call_line and DW_AT_call_column
271 /// from DIE (or zeroes if they are missing). This function looks for
272 /// DW_AT_call attributes in this DIE only, it will not resolve the attribute
273 /// values in any DW_AT_specification or DW_AT_abstract_origin DIEs.
274 /// \param CallFile filled in with non-zero if successful, zero if there is no
275 /// DW_AT_call_file attribute in this DIE.
276 /// \param CallLine filled in with non-zero if successful, zero if there is no
277 /// DW_AT_call_line attribute in this DIE.
278 /// \param CallColumn filled in with non-zero if successful, zero if there is
279 /// no DW_AT_call_column attribute in this DIE.
280 /// \param CallDiscriminator filled in with non-zero if successful, zero if
281 /// there is no DW_AT_GNU_discriminator attribute in this DIE.
282 LLVM_ABI void getCallerFrame(uint32_t &CallFile, uint32_t &CallLine,
283 uint32_t &CallColumn,
284 uint32_t &CallDiscriminator) const;
285
286 class attribute_iterator;
287
288 /// Get an iterator range to all attributes in the current DIE only.
289 ///
290 /// \returns an iterator range for the attributes of the current DIE.
292
293 /// Gets the type size (in bytes) for this DIE.
294 ///
295 /// \param PointerSize the pointer size of the containing CU.
296 /// \returns if this is a type DIE, or this DIE contains a DW_AT_type, returns
297 /// the size of the type.
298 LLVM_ABI std::optional<uint64_t> getTypeSize(uint64_t PointerSize);
299
300 class iterator;
301
302 iterator begin() const;
303 iterator end() const;
304
305 std::reverse_iterator<iterator> rbegin() const;
306 std::reverse_iterator<iterator> rend() const;
307
309};
310
312 : public iterator_facade_base<attribute_iterator, std::forward_iterator_tag,
313 const DWARFAttribute> {
314 /// The DWARF DIE we are extracting attributes from.
315 DWARFDie Die;
316 /// The value vended to clients via the operator*() or operator->().
317 DWARFAttribute AttrValue;
318 /// The attribute index within the abbreviation declaration in Die.
319 uint32_t Index;
320
321 friend bool operator==(const attribute_iterator &LHS,
322 const attribute_iterator &RHS);
323
324 /// Update the attribute index and attempt to read the attribute value. If the
325 /// attribute is able to be read, update AttrValue and the Index member
326 /// variable. If the attribute value is not able to be read, an appropriate
327 /// error will be set if the Err member variable is non-NULL and the iterator
328 /// will be set to the end value so iteration stops.
329 void updateForIndex(const DWARFAbbreviationDeclaration &AbbrDecl, uint32_t I);
330
331public:
333 LLVM_ABI explicit attribute_iterator(DWARFDie D, bool End);
334
337 explicit operator bool() const { return AttrValue.isValid(); }
338 const DWARFAttribute &operator*() const { return AttrValue; }
339};
340
343 return LHS.Index == RHS.Index;
344}
345
348 return !(LHS == RHS);
349}
350
351inline bool operator==(const DWARFDie &LHS, const DWARFDie &RHS) {
352 return LHS.getDebugInfoEntry() == RHS.getDebugInfoEntry() &&
353 LHS.getDwarfUnit() == RHS.getDwarfUnit();
354}
355
356inline bool operator!=(const DWARFDie &LHS, const DWARFDie &RHS) {
357 return !(LHS == RHS);
358}
359
360inline bool operator<(const DWARFDie &LHS, const DWARFDie &RHS) {
361 return LHS.getOffset() < RHS.getOffset();
362}
363
365 : public iterator_facade_base<iterator, std::bidirectional_iterator_tag,
366 const DWARFDie> {
367 DWARFDie Die;
368
369 friend std::reverse_iterator<llvm::DWARFDie::iterator>;
370 friend bool operator==(const DWARFDie::iterator &LHS,
371 const DWARFDie::iterator &RHS);
372
373public:
374 iterator() = default;
375
376 explicit iterator(DWARFDie D) : Die(D) {}
377
379 Die = Die.getSibling();
380 return *this;
381 }
382
384 Die = Die.getPreviousSibling();
385 return *this;
386 }
387
388 const DWARFDie &operator*() const { return Die; }
389};
390
392 const DWARFDie::iterator &RHS) {
393 return LHS.Die == RHS.Die;
394}
395
396// These inline functions must follow the DWARFDie::iterator definition above
397// as they use functions from that class.
399 return iterator(getFirstChild());
400}
401
403 return iterator(getLastChild());
404}
405
407 return make_range(begin(), end());
408}
409
410} // end namespace llvm
411
412namespace std {
413
414template <>
415class reverse_iterator<llvm::DWARFDie::iterator>
417 reverse_iterator<llvm::DWARFDie::iterator>,
418 bidirectional_iterator_tag, const llvm::DWARFDie> {
419
420private:
421 llvm::DWARFDie Die;
422 bool AtEnd;
423
424public:
426 : Die(It.Die), AtEnd(!It.Die.getPreviousSibling()) {
427 if (!AtEnd)
428 Die = Die.getPreviousSibling();
429 }
430
432 return llvm::DWARFDie::iterator(AtEnd ? Die : Die.getSibling());
433 }
434
435 reverse_iterator<llvm::DWARFDie::iterator> &operator++() {
436 assert(!AtEnd && "Incrementing rend");
438 if (D)
439 Die = D;
440 else
441 AtEnd = true;
442 return *this;
443 }
444
445 reverse_iterator<llvm::DWARFDie::iterator> &operator--() {
446 if (AtEnd) {
447 AtEnd = false;
448 return *this;
449 }
450 Die = Die.getSibling();
451 assert(!Die.isNULL() && "Decrementing rbegin");
452 return *this;
453 }
454
455 const llvm::DWARFDie &operator*() const {
456 assert(Die.isValid());
457 return Die;
458 }
459
460 // FIXME: We should be able to specify the equals operator as a friend, but
461 // that causes the compiler to think the operator overload is ambiguous
462 // with the friend declaration and the actual definition as candidates.
463 bool equals(const reverse_iterator<llvm::DWARFDie::iterator> &RHS) const {
464 return Die == RHS.Die && AtEnd == RHS.AtEnd;
465 }
466};
467
468} // namespace std
469
470namespace llvm {
471
472inline bool operator==(const std::reverse_iterator<DWARFDie::iterator> &LHS,
473 const std::reverse_iterator<DWARFDie::iterator> &RHS) {
474 return LHS.equals(RHS);
475}
476
477inline bool operator!=(const std::reverse_iterator<DWARFDie::iterator> &LHS,
478 const std::reverse_iterator<DWARFDie::iterator> &RHS) {
479 return !(LHS == RHS);
480}
481
482inline std::reverse_iterator<DWARFDie::iterator> DWARFDie::rbegin() const {
483 return std::make_reverse_iterator(end());
484}
485
486inline std::reverse_iterator<DWARFDie::iterator> DWARFDie::rend() const {
487 return std::make_reverse_iterator(begin());
488}
489
492 std::string *OriginalFullName = nullptr);
493
494} // end namespace llvm
495
496#endif // LLVM_DEBUGINFO_DWARF_DWARFDIE_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define LLVM_ABI
Definition: Compiler.h:213
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:638
This file contains constants used for implementing Dwarf debug support.
bool End
Definition: ELF_riscv.cpp:480
#define I(x, y, z)
Definition: MD5.cpp:58
raw_pwrite_stream & OS
Value * RHS
Value * LHS
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
A structured debug information entry.
Definition: DIE.h:828
DWARFDebugInfoEntry - A DIE with only the minimum required data.
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
const DWARFAttribute & operator*() const
Definition: DWARFDie.h:338
LLVM_ABI attribute_iterator & operator++()
Definition: DWARFDie.cpp:731
friend bool operator==(const attribute_iterator &LHS, const attribute_iterator &RHS)
Definition: DWARFDie.h:341
LLVM_ABI attribute_iterator & operator--()
iterator & operator--()
Definition: DWARFDie.h:383
iterator(DWARFDie D)
Definition: DWARFDie.h:376
friend bool operator==(const DWARFDie::iterator &LHS, const DWARFDie::iterator &RHS)
Definition: DWARFDie.h:391
iterator & operator++()
Definition: DWARFDie.h:378
const DWARFDie & operator*() const
Definition: DWARFDie.h:388
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Definition: DWARFDie.h:43
LLVM_ABI void getFullName(raw_string_ostream &, std::string *OriginalFullName=nullptr) const
Definition: DWARFDie.cpp:233
LLVM_ABI DWARFDie resolveTypeUnitReference() const
Definition: DWARFDie.cpp:329
LLVM_ABI std::optional< uint64_t > getLocBaseAttribute() const
Definition: DWARFDie.cpp:351
uint64_t getOffset() const
Get the absolute offset into the debug info or types section.
Definition: DWARFDie.h:68
LLVM_ABI const char * getShortName() const
Return the DIE short name resolving DW_AT_specification or DW_AT_abstract_origin references if necess...
Definition: DWARFDie.cpp:474
DWARFDie(DWARFUnit *Unit, const DWARFDebugInfoEntry *D)
Definition: DWARFDie.h:50
LLVM_ABI Expected< DWARFAddressRangesVector > getAddressRanges() const
Get the address ranges for this DIE.
Definition: DWARFDie.cpp:387
iterator_range< iterator > children() const
Definition: DWARFDie.h:406
std::reverse_iterator< iterator > rbegin() const
Definition: DWARFDie.h:482
LLVM_ABI DWARFDie getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE as the referenced DIE.
Definition: DWARFDie.cpp:306
LLVM_ABI DWARFDie getParent() const
Get the parent of this DIE object.
Definition: DWARFDie.cpp:655
LLVM_ABI std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
Definition: DWARFDie.cpp:250
iterator end() const
Definition: DWARFDie.h:402
DWARFUnit * getDwarfUnit() const
Definition: DWARFDie.h:55
const DWARFDebugInfoEntry * getDebugInfoEntry() const
Definition: DWARFDie.h:54
LLVM_ABI const char * getSubroutineName(DINameKind Kind) const
If a DIE represents a subprogram (or inlined subroutine), returns its mangled name (or short name,...
Definition: DWARFDie.cpp:457
bool hasChildren() const
Definition: DWARFDie.h:80
LLVM_ABI DWARFDie getSibling() const
Get the sibling of this DIE object.
Definition: DWARFDie.cpp:661
LLVM_ABI bool isSubroutineDIE() const
Returns true if DIE represents a subprogram or an inlined subroutine.
Definition: DWARFDie.cpp:245
LLVM_ABI bool getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC, uint64_t &SectionIndex) const
Retrieves DW_AT_low_pc and DW_AT_high_pc from CU.
Definition: DWARFDie.cpp:372
LLVM_ABI LLVM_DUMP_METHOD void dump() const
Convenience zero-argument overload for debugging.
Definition: DWARFDie.cpp:653
LLVM_ABI 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...
Definition: DWARFDie.cpp:502
LLVM_ABI bool isSubprogramDIE() const
Returns true if DIE represents a subprogram (not inlined).
Definition: DWARFDie.cpp:243
LLVM_ABI bool addressRangeContainsAddress(const uint64_t Address) const
Definition: DWARFDie.cpp:404
LLVM_ABI 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...
Definition: DWARFDie.cpp:274
LLVM_ABI std::optional< uint64_t > getHighPC(uint64_t LowPC) const
Get the DW_AT_high_pc attribute value as an address.
Definition: DWARFDie.cpp:355
LLVM_ABI std::optional< uint64_t > getTypeSize(uint64_t PointerSize)
Gets the type size (in bytes) for this DIE.
Definition: DWARFDie.cpp:578
LLVM_ABI DWARFDie resolveReferencedType(dwarf::Attribute Attr) const
Definition: DWARFDie.cpp:340
LLVM_ABI const char * getName(DINameKind Kind) const
Return the DIE name resolving DW_AT_specification or DW_AT_abstract_origin references if necessary.
Definition: DWARFDie.cpp:463
LLVM_ABI DWARFDie getLastChild() const
Get the last child of this DIE object.
Definition: DWARFDie.cpp:679
LLVM_ABI DWARFDie getPreviousSibling() const
Get the previous sibling of this DIE object.
Definition: DWARFDie.cpp:667
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Get the abbreviation declaration for this DIE.
Definition: DWARFDie.h:60
DWARFDie()=default
iterator begin() const
Definition: DWARFDie.h:398
LLVM_ABI std::string getDeclFile(DILineInfoSpecifier::FileLineInfoKind Kind) const
Definition: DWARFDie.cpp:495
LLVM_ABI DWARFDie getFirstChild() const
Get the first child of this DIE object.
Definition: DWARFDie.cpp:673
LLVM_ABI uint64_t getDeclLine() const
Returns the declaration line (start line) for a DIE, assuming it specifies a subprogram.
Definition: DWARFDie.cpp:490
dwarf::Tag getTag() const
Definition: DWARFDie.h:73
LLVM_ABI const char * getLinkageName() const
Return the DIE linkage name resolving DW_AT_specification or DW_AT_abstract_origin references if nece...
Definition: DWARFDie.cpp:481
LLVM_ABI Expected< DWARFLocationExpressionsVector > getLocations(dwarf::Attribute Attr) const
Definition: DWARFDie.cpp:427
LLVM_ABI std::optional< uint64_t > getRangesBaseAttribute() const
Extract the range base attribute from this DIE as absolute section offset.
Definition: DWARFDie.cpp:347
bool isNULL() const
Returns true for a valid DIE that terminates a sibling chain.
Definition: DWARFDie.h:86
LLVM_ABI std::optional< uint64_t > getLanguage() const
Definition: DWARFDie.cpp:417
bool isValid() const
Definition: DWARFDie.h:52
LLVM_ABI iterator_range< attribute_iterator > attributes() const
Get an iterator range to all attributes in the current DIE only.
Definition: DWARFDie.cpp:685
std::reverse_iterator< iterator > rend() const
Definition: DWARFDie.h:486
Tagged union holding either a T or a Error.
Definition: Error.h:485
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition: iterator.h:80
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:662
reverse_iterator< llvm::DWARFDie::iterator > & operator++()
Definition: DWARFDie.h:435
const llvm::DWARFDie & operator*() const
Definition: DWARFDie.h:455
bool equals(const reverse_iterator< llvm::DWARFDie::iterator > &RHS) const
Definition: DWARFDie.h:463
llvm::DWARFDie::iterator base() const
Definition: DWARFDie.h:431
reverse_iterator< llvm::DWARFDie::iterator > & operator--()
Definition: DWARFDie.h:445
reverse_iterator(llvm::DWARFDie::iterator It)
Definition: DWARFDie.h:425
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
Attribute
Attributes.
Definition: Dwarf.h:124
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool operator<(int64_t V1, const APSInt &V2)
Definition: APSInt.h:362
bool operator!=(uint64_t V1, const APInt &V2)
Definition: APInt.h:2113
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
LLVM_ABI void dumpTypeQualifiedName(const DWARFDie &DIE, raw_ostream &OS)
Definition: DWARFDie.cpp:795
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
Definition: DIContext.h:142
LLVM_ABI void dumpTypeUnqualifiedName(const DWARFDie &DIE, raw_ostream &OS, std::string *OriginalFullName=nullptr)
Definition: DWARFDie.cpp:799
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:856
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:196
Encapsulates a DWARF attribute value and all of the data required to describe the attribute value.
bool isValid() const