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