LLVM 23.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");
62 return Die->getAbbreviationDeclarationPtr();
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 /// Returns the DW_LANG_ code for this DIE's DWARF unit, if it exists.
234 LLVM_ABI std::optional<uint64_t> getLanguage() const;
235
237 getLocations(dwarf::Attribute Attr) const;
238
239 /// If a DIE represents a subprogram (or inlined subroutine), returns its
240 /// mangled name (or short name, if mangled is missing). This name may be
241 /// fetched from specification or abstract origin for this subprogram.
242 /// Returns null if no name is found.
243 LLVM_ABI const char *getSubroutineName(DINameKind Kind) const;
244
245 /// Return the DIE name resolving DW_AT_specification or DW_AT_abstract_origin
246 /// references if necessary. For the LinkageName case it additionaly searches
247 /// for ShortName if LinkageName is not found.
248 /// Returns null if no name is found.
249 LLVM_ABI const char *getName(DINameKind Kind) const;
251 std::string *OriginalFullName = nullptr) const;
252
253 /// Return the DIE short name resolving DW_AT_specification or
254 /// DW_AT_abstract_origin references if necessary. Returns null if no name
255 /// is found.
256 LLVM_ABI const char *getShortName() const;
257
258 /// Return the DIE linkage name resolving DW_AT_specification or
259 /// DW_AT_abstract_origin references if necessary. Returns null if no name
260 /// is found.
261 LLVM_ABI const char *getLinkageName() const;
262
263 /// Returns the declaration line (start line) for a DIE, assuming it specifies
264 /// a subprogram. This may be fetched from specification or abstract origin
265 /// for this subprogram by resolving DW_AT_sepcification or
266 /// DW_AT_abstract_origin references if necessary.
268 LLVM_ABI std::string
270
271 /// Retrieves values of DW_AT_call_file, DW_AT_call_line and DW_AT_call_column
272 /// from DIE (or zeroes if they are missing). This function looks for
273 /// DW_AT_call attributes in this DIE only, it will not resolve the attribute
274 /// values in any DW_AT_specification or DW_AT_abstract_origin DIEs.
275 /// \param CallFile filled in with non-zero if successful, zero if there is no
276 /// DW_AT_call_file attribute in this DIE.
277 /// \param CallLine filled in with non-zero if successful, zero if there is no
278 /// DW_AT_call_line attribute in this DIE.
279 /// \param CallColumn filled in with non-zero if successful, zero if there is
280 /// no DW_AT_call_column attribute in this DIE.
281 /// \param CallDiscriminator filled in with non-zero if successful, zero if
282 /// there is no DW_AT_GNU_discriminator attribute in this DIE.
283 LLVM_ABI void getCallerFrame(uint32_t &CallFile, uint32_t &CallLine,
284 uint32_t &CallColumn,
285 uint32_t &CallDiscriminator) const;
286
287 class attribute_iterator;
288
289 /// Get an iterator range to all attributes in the current DIE only.
290 ///
291 /// \returns an iterator range for the attributes of the current DIE.
293
294 /// Gets the type size (in bytes) for this DIE.
295 ///
296 /// \param PointerSize the pointer size of the containing CU.
297 /// \returns if this is a type DIE, or this DIE contains a DW_AT_type, returns
298 /// the size of the type.
299 LLVM_ABI std::optional<uint64_t> getTypeSize(uint64_t PointerSize);
300
301 class iterator;
302
303 iterator begin() const;
304 iterator end() const;
305
306 std::reverse_iterator<iterator> rbegin() const;
307 std::reverse_iterator<iterator> rend() const;
308
310};
311
313 : public iterator_facade_base<attribute_iterator, std::forward_iterator_tag,
314 const DWARFAttribute> {
315 /// The DWARF DIE we are extracting attributes from.
316 DWARFDie Die;
317 /// The value vended to clients via the operator*() or operator->().
318 DWARFAttribute AttrValue;
319 /// The attribute index within the abbreviation declaration in Die.
320 uint32_t Index;
321
322 friend bool operator==(const attribute_iterator &LHS,
323 const attribute_iterator &RHS);
324
325 /// Update the attribute index and attempt to read the attribute value. If the
326 /// attribute is able to be read, update AttrValue and the Index member
327 /// variable. If the attribute value is not able to be read, an appropriate
328 /// error will be set if the Err member variable is non-NULL and the iterator
329 /// will be set to the end value so iteration stops.
330 void updateForIndex(const DWARFAbbreviationDeclaration &AbbrDecl, uint32_t I);
331
332public:
334 LLVM_ABI explicit attribute_iterator(DWARFDie D, bool End);
335
338 explicit operator bool() const { return AttrValue.isValid(); }
339 const DWARFAttribute &operator*() const { return AttrValue; }
340};
341
344 return LHS.Index == RHS.Index;
345}
346
349 return !(LHS == RHS);
350}
351
352inline bool operator==(const DWARFDie &LHS, const DWARFDie &RHS) {
353 return LHS.getDebugInfoEntry() == RHS.getDebugInfoEntry() &&
354 LHS.getDwarfUnit() == RHS.getDwarfUnit();
355}
356
357inline bool operator!=(const DWARFDie &LHS, const DWARFDie &RHS) {
358 return !(LHS == RHS);
359}
360
361inline bool operator<(const DWARFDie &LHS, const DWARFDie &RHS) {
362 return LHS.getOffset() < RHS.getOffset();
363}
364
366 : public iterator_facade_base<iterator, std::bidirectional_iterator_tag,
367 const DWARFDie> {
368 DWARFDie Die;
369
370 friend std::reverse_iterator<llvm::DWARFDie::iterator>;
371 friend bool operator==(const DWARFDie::iterator &LHS,
372 const DWARFDie::iterator &RHS);
373
374public:
375 iterator() = default;
376
377 explicit iterator(DWARFDie D) : Die(D) {}
378
380 Die = Die.getSibling();
381 return *this;
382 }
383
385 Die = Die.getPreviousSibling();
386 return *this;
387 }
388
389 const DWARFDie &operator*() const { return Die; }
390};
391
393 const DWARFDie::iterator &RHS) {
394 return LHS.Die == RHS.Die;
395}
396
397// These inline functions must follow the DWARFDie::iterator definition above
398// as they use functions from that class.
400 return iterator(getFirstChild());
401}
402
404 return iterator(getLastChild());
405}
406
410
411} // end namespace llvm
412
413namespace std {
414
415template <>
416class reverse_iterator<llvm::DWARFDie::iterator>
418 reverse_iterator<llvm::DWARFDie::iterator>,
419 bidirectional_iterator_tag, const llvm::DWARFDie> {
420
421private:
422 llvm::DWARFDie Die;
423 bool AtEnd;
424
425public:
427 : Die(It.Die), AtEnd(!It.Die.getPreviousSibling()) {
428 if (!AtEnd)
429 Die = Die.getPreviousSibling();
430 }
431
433 return llvm::DWARFDie::iterator(AtEnd ? Die : Die.getSibling());
434 }
435
437 assert(!AtEnd && "Incrementing rend");
438 llvm::DWARFDie D = Die.getPreviousSibling();
439 if (D)
440 Die = D;
441 else
442 AtEnd = true;
443 return *this;
444 }
445
447 if (AtEnd) {
448 AtEnd = false;
449 return *this;
450 }
451 Die = Die.getSibling();
452 assert(!Die.isNULL() && "Decrementing rbegin");
453 return *this;
454 }
455
456 const llvm::DWARFDie &operator*() const {
457 assert(Die.isValid());
458 return Die;
459 }
460
461 // FIXME: We should be able to specify the equals operator as a friend, but
462 // that causes the compiler to think the operator overload is ambiguous
463 // with the friend declaration and the actual definition as candidates.
465 return Die == RHS.Die && AtEnd == RHS.AtEnd;
466 }
467};
468
469} // namespace std
470
471namespace llvm {
472
473inline bool operator==(const std::reverse_iterator<DWARFDie::iterator> &LHS,
474 const std::reverse_iterator<DWARFDie::iterator> &RHS) {
475 return LHS.equals(RHS);
476}
477
478inline bool operator!=(const std::reverse_iterator<DWARFDie::iterator> &LHS,
479 const std::reverse_iterator<DWARFDie::iterator> &RHS) {
480 return !(LHS == RHS);
481}
482
483inline std::reverse_iterator<DWARFDie::iterator> DWARFDie::rbegin() const {
484 return std::make_reverse_iterator(end());
485}
486
487inline std::reverse_iterator<DWARFDie::iterator> DWARFDie::rend() const {
488 return std::make_reverse_iterator(begin());
489}
490
493 std::string *OriginalFullName = nullptr);
494
495} // end namespace llvm
496
497#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:215
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition Compiler.h:672
This file contains constants used for implementing Dwarf debug support.
#define I(x, y, z)
Definition MD5.cpp:57
Value * RHS
Value * LHS
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
A structured debug information entry.
Definition DIE.h:840
DWARFDebugInfoEntry - A DIE with only the minimum required data.
const DWARFAttribute & operator*() const
Definition DWARFDie.h:339
LLVM_ABI attribute_iterator & operator++()
Definition DWARFDie.cpp:812
friend bool operator==(const attribute_iterator &LHS, const attribute_iterator &RHS)
Definition DWARFDie.h:342
LLVM_ABI attribute_iterator & operator--()
iterator & operator--()
Definition DWARFDie.h:384
friend bool operator==(const DWARFDie::iterator &LHS, const DWARFDie::iterator &RHS)
Definition DWARFDie.h:392
iterator & operator++()
Definition DWARFDie.h:379
const DWARFDie & operator*() const
Definition DWARFDie.h:389
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:300
LLVM_ABI DWARFDie resolveTypeUnitReference() const
Definition DWARFDie.cpp:396
LLVM_ABI std::optional< uint64_t > getLocBaseAttribute() const
Definition DWARFDie.cpp:418
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:553
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:454
iterator_range< iterator > children() const
Definition DWARFDie.h:407
std::reverse_iterator< iterator > rbegin() const
Definition DWARFDie.h:483
LLVM_ABI DWARFDie getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE as the referenced DIE.
Definition DWARFDie.cpp:373
LLVM_ABI DWARFDie getParent() const
Get the parent of this DIE object.
Definition DWARFDie.cpp:736
LLVM_ABI std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
Definition DWARFDie.cpp:317
iterator end() const
Definition DWARFDie.h:403
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:536
bool hasChildren() const
Definition DWARFDie.h:80
LLVM_ABI DWARFDie getSibling() const
Get the sibling of this DIE object.
Definition DWARFDie.cpp:742
LLVM_ABI bool isSubroutineDIE() const
Returns true if DIE represents a subprogram or an inlined subroutine.
Definition DWARFDie.cpp:312
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:439
LLVM_ABI LLVM_DUMP_METHOD void dump() const
Convenience zero-argument overload for debugging.
Definition DWARFDie.cpp:734
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:581
LLVM_ABI bool isSubprogramDIE() const
Returns true if DIE represents a subprogram (not inlined).
Definition DWARFDie.cpp:310
LLVM_ABI bool addressRangeContainsAddress(const uint64_t Address) const
Definition DWARFDie.cpp:471
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:341
llvm::DWARFFormValue DWARFFormValue
Definition DWARFDie.h:48
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:422
LLVM_ABI std::optional< uint64_t > getTypeSize(uint64_t PointerSize)
Gets the type size (in bytes) for this DIE.
Definition DWARFDie.cpp:657
LLVM_ABI DWARFDie resolveReferencedType(dwarf::Attribute Attr) const
Definition DWARFDie.cpp:407
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:542
LLVM_ABI DWARFDie getLastChild() const
Get the last child of this DIE object.
Definition DWARFDie.cpp:760
LLVM_ABI DWARFDie getPreviousSibling() const
Get the previous sibling of this DIE object.
Definition DWARFDie.cpp:748
const DWARFAbbreviationDeclaration * getAbbreviationDeclarationPtr() const
Get the abbreviation declaration for this DIE.
Definition DWARFDie.h:60
DWARFDie()=default
iterator begin() const
Definition DWARFDie.h:399
LLVM_ABI std::string getDeclFile(DILineInfoSpecifier::FileLineInfoKind Kind) const
Definition DWARFDie.cpp:574
LLVM_ABI DWARFDie getFirstChild() const
Get the first child of this DIE object.
Definition DWARFDie.cpp:754
LLVM_ABI uint64_t getDeclLine() const
Returns the declaration line (start line) for a DIE, assuming it specifies a subprogram.
Definition DWARFDie.cpp:569
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:560
LLVM_ABI Expected< DWARFLocationExpressionsVector > getLocations(dwarf::Attribute Attr) const
Definition DWARFDie.cpp:506
LLVM_ABI std::optional< uint64_t > getRangesBaseAttribute() const
Extract the range base attribute from this DIE as absolute section offset.
Definition DWARFDie.cpp:414
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
Returns the DW_LANG_ code for this DIE's DWARF unit, if it exists.
Definition DWARFDie.cpp:488
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:766
std::reverse_iterator< iterator > rend() const
Definition DWARFDie.h:487
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.
reverse_iterator< llvm::DWARFDie::iterator > & operator++()
Definition DWARFDie.h:436
const llvm::DWARFDie & operator*() const
Definition DWARFDie.h:456
bool equals(const reverse_iterator< llvm::DWARFDie::iterator > &RHS) const
Definition DWARFDie.h:464
llvm::DWARFDie::iterator base() const
Definition DWARFDie.h:432
reverse_iterator< llvm::DWARFDie::iterator > & operator--()
Definition DWARFDie.h:446
reverse_iterator(llvm::DWARFDie::iterator It)
Definition DWARFDie.h:426
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
Attribute
Attributes.
Definition Dwarf.h:125
This is an optimization pass for GlobalISel generic memory operations.
bool operator<(int64_t V1, const APSInt &V2)
Definition APSInt.h:360
bool operator!=(uint64_t V1, const APInt &V2)
Definition APInt.h:2144
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:877
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:881
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:860
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.