LLVM: include/llvm/DebugInfo/LogicalView/Core/LVObject.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVOBJECT_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVOBJECT_H
16
22#include
23#include
24
25namespace llvm {
27
29}
30}
31
32namespace llvm {
33namespace logicalview {
34
43
53
56
62
75
83
87
88
89
90
91
92
93
94
95
97
100
101
103
104
117
119 enum class Property {
120 IsLocation,
121 IsGlobalReference,
122 IsGeneratedName,
123 IsResolved,
124 IsResolvedName,
125 IsDiscarded,
126 IsOptimized,
127 IsAdded,
128 IsMatched,
129 IsMissing,
130 IsMissingLink,
131 IsInCompare,
132 IsFileFromReference,
133 IsLineFromReference,
134 HasMoved,
135 HasPattern,
136 IsFinalized,
137 IsReferenced,
138 HasCodeViewLocation,
139 LastEntry
140 };
141
145 union {
149 } TagAttrOpcode = {dwarf::DW_TAG_null};
150
151 LVProperties Properties;
152
153
154
155
158
159
160
161 union {
165 } Parent = {nullptr};
166
167
168
169
170
171
172 LVObject(const LVObject &Object) {
173 incID();
174 Properties = Object.Properties;
175 Offset = Object.Offset;
176 LineNumber = Object.LineNumber;
177 ScopeLevel = Object.ScopeLevel;
178 TagAttrOpcode = Object.TagAttrOpcode;
179 Parent = Object.Parent;
180 }
181
182 void incID() {
183 ++GID;
184 ID = GID;
185 }
186
187protected:
188
189 std::string lineAsString(uint32_t LineNumber, LVHalf Discriminator,
190 bool ShowZero) const;
191
192
193 std::string referenceAsString(uint32_t LineNumber, bool Spaces) const;
194
195
196
197
199
200public:
202 LVObject &operator=(const LVObject &) = delete;
204
224
225
226 virtual bool isNamed() const { return false; }
227 virtual bool isTyped() const { return false; }
228 virtual bool isFiled() const { return false; }
229 bool isLined() const { return LineNumber != 0; }
230
231
238
239
242
243
246
249
251 assert((!Parent.Element || static_cast<LVElement *>(Parent.Element)) &&
252 "Invalid element");
253 return Parent.Element;
254 }
256 assert((!Parent.Scope || static_cast<LVScope *>(Parent.Scope)) &&
257 "Invalid scope");
258 return Parent.Scope;
259 }
261 assert((!Parent.Symbol || static_cast<LVSymbol *>(Parent.Symbol)) &&
262 "Invalid symbol");
263 return Parent.Symbol;
264 }
265 void setParent(LVScope *Scope);
266 void setParent(LVSymbol *Symbol);
268
273
276
277 virtual const char *kind() const { return nullptr; }
278
279 std::string indentAsString() const;
280 std::string indentAsString(LVLevel Level) const;
281
282
283 virtual std::string noLineAsString(bool ShowZero) const;
284
285
286
290 std::string lineNumberAsStringStripped(bool ShowZero = false) const;
291
292
293
294
295
296
297
298
299
301 bool Full = true) const;
302 void printAttributes(raw_ostream &OS, bool Full = true) const;
305 bool UseQuotes = false, bool PrintRef = false) const;
306
307
308 void markBranchAsMissing();
309
310
312
313
315
316#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
318#endif
319
321};
322
323}
324}
325
326#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static cl::opt< bool > PrintRef("print-ref", cl::ReallyHidden)
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
This file contains constants used for implementing Dwarf debug support.
Lightweight error class with error context and mandatory checking.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
Helper to store a sequence of ranges being concatenated and access them.
Definition LVObject.h:118
PROPERTY(Property, IsDiscarded)
LVElement * Element
Definition LVObject.h:162
uint32_t getID() const
Definition LVObject.h:320
virtual StringRef getName() const
Definition LVObject.h:247
virtual bool isFiled() const
Definition LVObject.h:228
PROPERTY(Property, IsAdded)
virtual LVAddress getUpperAddress() const
Definition LVObject.h:271
PROPERTY(Property, IsGeneratedName)
virtual const char * kind() const
Definition LVObject.h:277
LVObject & operator=(const LVObject &)=delete
LVScope * getParentScope() const
Definition LVObject.h:255
dwarf::Tag getTag() const
Definition LVObject.h:232
void dump() const
Definition LVObject.h:317
LVSmall getOpcode() const
Definition LVObject.h:236
PROPERTY(Property, IsMissing)
std::string lineAsString(uint32_t LineNumber, LVHalf Discriminator, bool ShowZero) const
virtual void setLowerAddress(LVAddress Address)
Definition LVObject.h:270
dwarf::Attribute Attr
Definition LVObject.h:147
LVObject()
Definition LVObject.h:201
void resetParent()
Definition LVObject.h:267
void setLevel(LVLevel Level)
Definition LVObject.h:245
dwarf::Attribute getAttr() const
Definition LVObject.h:234
virtual std::string lineNumberAsString(bool ShowZero=false) const
Definition LVObject.h:287
virtual void setName(StringRef ObjectName)
Definition LVObject.h:248
void setOpcode(LVSmall Opcode)
Definition LVObject.h:237
PROPERTY(Property, IsLineFromReference)
virtual void printExtra(raw_ostream &OS, bool Full=true) const
Definition LVObject.h:314
PROPERTY(Property, IsMissingLink)
virtual bool isNamed() const
Definition LVObject.h:226
virtual bool isTyped() const
Definition LVObject.h:227
LVLevel getLevel() const
Definition LVObject.h:244
PROPERTY(Property, IsReferenced)
PROPERTY(Property, HasMoved)
PROPERTY(Property, IsResolvedName)
void setAttr(dwarf::Attribute Attr)
Definition LVObject.h:235
PROPERTY(Property, IsLocation)
virtual ~LVObject()=default
virtual void printFileIndex(raw_ostream &OS, bool Full=true) const
Definition LVObject.h:198
PROPERTY(Property, IsMatched)
PROPERTY(Property, HasPattern)
LVSymbol * getParentSymbol() const
Definition LVObject.h:260
uint32_t getLineNumber() const
Definition LVObject.h:274
PROPERTY(Property, IsResolved)
void setOffset(LVOffset DieOffset)
Definition LVObject.h:241
LVSymbol * Symbol
Definition LVObject.h:164
LVOffset getOffset() const
Definition LVObject.h:240
LVSmall Opcode
Definition LVObject.h:148
PROPERTY(Property, IsFinalized)
PROPERTY(Property, HasCodeViewLocation)
bool isLined() const
Definition LVObject.h:229
void setLineNumber(uint32_t Number)
Definition LVObject.h:275
LVElement * getParent() const
Definition LVObject.h:250
void setTag(dwarf::Tag Tag)
Definition LVObject.h:233
PROPERTY(Property, IsFileFromReference)
PROPERTY(Property, IsInCompare)
PROPERTY(Property, IsOptimized)
virtual void setUpperAddress(LVAddress Address)
Definition LVObject.h:272
virtual LVAddress getLowerAddress() const
Definition LVObject.h:269
PROPERTY(Property, IsGlobalReference)
dwarf::Tag Tag
Definition LVObject.h:146
LVScope * Scope
Definition LVObject.h:163
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Calculates the starting offsets for various sections within the .debug_names section.
constexpr Tag DW_TAG_unaligned
Definition LVObject.h:28
SmallVector< LVOperation *, 8 > LVOperations
Definition LVObject.h:79
bool(LVSymbol::*)() const LVSymbolGetFunction
Definition LVObject.h:72
SmallVector< LVOffset, 8 > LVOffsets
Definition LVObject.h:86
uint16_t LVLevel
Definition LVObject.h:38
uint64_t LVOffset
Definition LVObject.h:39
bool(LVType::*)() const LVTypeGetFunction
Definition LVObject.h:74
SmallVector< LVElement *, 8 > LVElements
Definition LVObject.h:76
LVComparePass
Definition LVObject.h:99
@ Missing
Definition LVObject.h:99
@ Added
Definition LVObject.h:99
void(LVLine::*)() LVLineSetFunction
Definition LVObject.h:65
bool(LVScope::*)() const LVScopeGetFunction
Definition LVObject.h:70
uint64_t LVUnsigned
Definition LVObject.h:41
int64_t LVSigned
Definition LVObject.h:40
SmallVector< LVScope *, 8 > LVScopes
Definition LVObject.h:80
bool(LVLocation::*)() LVValidLocation
Definition LVObject.h:102
LLVM_ABI StringRef typeUnknown()
LVBinaryType
Definition LVObject.h:98
@ COFF
Definition LVObject.h:98
@ NONE
Definition LVObject.h:98
@ ELF
Definition LVObject.h:98
LLVM_ABI StringRef emptyString()
void(LVScope::*)() LVScopeSetFunction
Definition LVObject.h:69
LLVM_ABI StringRef typeNone()
detail::concat_range< LVElement *const, const LVScopes &, const LVTypes &, const LVSymbols & > LVElementsView
Definition LVObject.h:84
const LVAddress MaxAddress
Definition LVObject.h:96
SmallVector< LVSymbol *, 8 > LVSymbols
Definition LVObject.h:81
uint8_t LVSmall
Definition LVObject.h:42
bool(LVLine::*)() const LVLineGetFunction
Definition LVObject.h:66
uint64_t LVSectionIndex
Definition LVObject.h:35
bool(LVElement::*)() const LVElementGetFunction
Definition LVObject.h:64
void(LVSymbol::*)() LVSymbolSetFunction
Definition LVObject.h:71
SmallVector< LVLine *, 8 > LVLines
Definition LVObject.h:77
LLVM_ABI StringRef typeInt()
uint64_t LVAddress
Definition LVObject.h:36
bool(LVObject::*)() const LVObjectGetFunction
Definition LVObject.h:68
uint16_t LVHalf
Definition LVObject.h:37
void(LVElement::*)() LVElementSetFunction
Definition LVObject.h:63
LLVM_ABI StringRef typeVoid()
void(LVType::*)() LVTypeSetFunction
Definition LVObject.h:73
SmallVector< LVType *, 8 > LVTypes
Definition LVObject.h:82
void(LVObject::*)() LVObjectSetFunction
Definition LVObject.h:67
SmallVector< LVLocation *, 8 > LVLocations
Definition LVObject.h:78
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition LVObject.h:105
unsigned Scopes
Definition LVObject.h:107
unsigned Lines
Definition LVObject.h:106
void reset()
Definition LVObject.h:110
unsigned Symbols
Definition LVObject.h:108
unsigned Types
Definition LVObject.h:109