LLVM: include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_DEBUGINFO_DWARF_DWARFUNITINDEX_H
10#define LLVM_DEBUGINFO_DWARF_DWARFUNITINDEX_H
11
15#include
16#include
17
18namespace llvm {
19
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
58
59
61#define HANDLE_DW_SECT(ID, NAME) DW_SECT_##NAME = ID,
62#include "llvm/BinaryFormat/Dwarf.def"
66};
67
69 switch (Kind) {
71 return "Unknown DW_SECT value 0";
72#define STRINGIZE(X) #X
73#define HANDLE_DW_SECT(ID, NAME) \
74 case DW_SECT_##NAME: \
75 return "DW_SECT_" STRINGIZE(NAME);
76#include "llvm/BinaryFormat/Dwarf.def"
78 return "DW_SECT_TYPES";
80 return "DW_SECT_LOC";
82 return "DW_SECT_MACINFO";
83 }
85}
86
87
88
89
90
91
93 unsigned IndexVersion);
94
95
96
97
98
100 unsigned IndexVersion);
101
103 struct Header {
108
111 };
112
113public:
115 public:
117 private:
120
121 public:
124 : Offset(Offset), Length(Length) {}
125
132 };
133
134 private:
137 std::unique_ptr<SectionContribution[]> Contributions;
139
140 public:
145
147 return Contributions.get();
148 }
149
152 };
153
154private:
155 struct Header Header;
156
158 int InfoColumn = -1;
159 std::unique_ptr<DWARFSectionKind[]> ColumnKinds;
160
161
162
163 std::unique_ptr<uint32_t[]> RawSectionIds;
164 std::unique_ptr<Entry[]> Rows;
165 mutable std::vector<Entry *> OffsetLookup;
166
168
170
171public:
173 : InfoColumnKind(InfoColumnKind) {}
174
175 explicit operator bool() const { return Header.NumBuckets; }
176
179
181
184
186 return ArrayRef(ColumnKinds.get(), Header.NumColumns);
187 }
188
190 return ArrayRef(Rows.get(), Header.NumBuckets);
191 }
192
196};
197
198}
199
200#endif
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition DWARFUnitIndex.h:116
uint32_t getOffset32() const
Definition DWARFUnitIndex.h:130
uint64_t getLength() const
Definition DWARFUnitIndex.h:129
void setOffset(uint64_t Value)
Definition DWARFUnitIndex.h:126
void setLength(uint64_t Value)
Definition DWARFUnitIndex.h:127
uint32_t getLength32() const
Definition DWARFUnitIndex.h:131
SectionContribution()
Definition DWARFUnitIndex.h:122
SectionContribution(uint64_t Offset, uint64_t Length)
Definition DWARFUnitIndex.h:123
uint64_t getOffset() const
Definition DWARFUnitIndex.h:128
Definition DWARFUnitIndex.h:114
uint64_t getSignature() const
Definition DWARFUnitIndex.h:150
bool isValid()
Definition DWARFUnitIndex.h:151
LLVM_ABI const SectionContribution * getContribution() const
const SectionContribution * getContributions() const
Definition DWARFUnitIndex.h:146
friend class DWARFUnitIndex
Definition DWARFUnitIndex.h:138
uint32_t getVersion() const
Definition DWARFUnitIndex.h:180
MutableArrayRef< Entry > getMutableRows()
Definition DWARFUnitIndex.h:193
LLVM_ABI void dump(raw_ostream &OS) const
LLVM_ABI bool parse(DataExtractor IndexData)
DWARFUnitIndex(DWARFSectionKind InfoColumnKind)
Definition DWARFUnitIndex.h:172
LLVM_ABI const Entry * getFromHash(uint64_t Offset) const
ArrayRef< DWARFSectionKind > getColumnKinds() const
Definition DWARFUnitIndex.h:185
ArrayRef< Entry > getRows() const
Definition DWARFUnitIndex.h:189
LLVM_ABI const Entry * getFromOffset(uint64_t Offset) const
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI DWARFSectionKind deserializeSectionKind(uint32_t Value, unsigned IndexVersion)
Convert a value read from an index section to the internal representation.
DWARFSectionKind
The enum of section identifiers to be used in internal interfaces.
Definition DWARFUnitIndex.h:57
@ DW_SECT_EXT_LOC
Definition DWARFUnitIndex.h:64
@ DW_SECT_EXT_unknown
Denotes a value read from an index section that does not correspond to any of the supported standards...
Definition DWARFUnitIndex.h:60
@ DW_SECT_EXT_TYPES
Definition DWARFUnitIndex.h:63
@ DW_SECT_EXT_MACINFO
Definition DWARFUnitIndex.h:65
LLVM_ABI uint32_t serializeSectionKind(DWARFSectionKind Kind, unsigned IndexVersion)
Convert the internal value for a section kind to an on-disk value.
FunctionAddr VTableAddr uintptr_t uintptr_t Version
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
ArrayRef(const T &OneElt) -> ArrayRef< T >
std::string toString(const APInt &I, unsigned Radix, bool Signed, bool formatAsCLiteral=false, bool UpperCase=true, bool InsertSeparators=false)