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