LLVM: include/llvm/DebugInfo/LogicalView/Core/LVType.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVTYPE_H
15#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVTYPE_H
16
19
20namespace llvm {
22
48using LVTypeDispatch = std::map<LVTypeKind, LVTypeGetFunction>;
50
51
53 enum class Property { IsSubrangeCount, LastEntry };
54
55
59
60
62
63
65
66public:
71
75
97
99
100 const char *kind() const override;
101
102
103
105
106 bool isBase() const override { return getIsBase(); }
107 bool isTemplateParam() const override { return getIsTemplateParam(); }
108
109
111
112
115
116
119
120 void resolveName() override;
121 void resolveReferences() override;
122
124
125 static bool parametersMatch(const LVTypes *References,
127
130
131
132
133
134 static void markMissingParents(const LVTypes *References,
136
137
138 virtual bool equals(const LVType *Type) const;
139
140
141
142 static bool equals(const LVTypes *References, const LVTypes *Targets);
143
144
146
148 void printExtra(raw_ostream &OS, bool Full = true) const override;
149};
150
151
153public:
155 setIsTypedef();
156 setIncludeInPrint();
157 }
161
162
165
166 void resolveExtra() override;
167
168
169 bool equals(const LVType *Type) const override;
170
171 void printExtra(raw_ostream &OS, bool Full = true) const override;
172};
173
174
176
177 size_t ValueIndex = 0;
178
179public:
181 setIsEnumerator();
182 setIncludeInPrint();
183 }
187
188
196
197
198 bool equals(const LVType *Type) const override;
199
200 void printExtra(raw_ostream &OS, bool Full = true) const override;
201};
202
203
205public:
210
211
213
215};
216
217
219
220 size_t ValueIndex = 0;
221
222public:
227
228
236
237
238 void encodeTemplateArgument(std::string &Name) const override;
239
240
241 bool equals(const LVType *Type) const override;
242
243 void printExtra(raw_ostream &OS, bool Full = true) const override;
244};
245
246
248
249 int64_t LowerBound = 0;
250 int64_t UpperBound = 0;
251
252public:
254 setIsSubrange();
255 setIncludeInPrint();
256 }
260
262 return getIsSubrangeCount() ? LowerBound : 0;
263 }
265 LowerBound = Value;
266 setIsSubrangeCount();
267 }
268
269 int64_t getLowerBound() const override { return LowerBound; }
271
272 int64_t getUpperBound() const override { return UpperBound; }
274
275 std::pair<unsigned, unsigned> getBounds() const override {
276 return {LowerBound, UpperBound};
277 }
279 LowerBound = Lower;
280 UpperBound = Upper;
281 }
282
283 void resolveExtra() override;
284
285
286 bool equals(const LVType *Type) const override;
287
288 void printExtra(raw_ostream &OS, bool Full = true) const override;
289};
290
291}
292}
293
294#endif
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
Pass interface - Implemented by all 'passes'.
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
LVElement(LVSubclassID ID)
void setType(LVElement *Element=nullptr)
~LVTypeDefinition() override=default
void setUnderlyingType(LVElement *Element) override
Definition LVType.h:164
LVTypeDefinition & operator=(const LVTypeDefinition &)=delete
LVTypeDefinition()
Definition LVType.h:154
LVTypeDefinition(const LVTypeDefinition &)=delete
LVElement * getUnderlyingType() override
size_t getValueIndex() const override
Definition LVType.h:195
void setValue(StringRef Value) override
Definition LVType.h:192
LVTypeEnumerator(const LVTypeEnumerator &)=delete
~LVTypeEnumerator() override=default
StringRef getValue() const override
Definition LVType.h:189
LVTypeEnumerator & operator=(const LVTypeEnumerator &)=delete
LVTypeEnumerator()
Definition LVType.h:180
LVTypeImport(const LVTypeImport &)=delete
~LVTypeImport() override=default
void printExtra(raw_ostream &OS, bool Full=true) const override
LVTypeImport & operator=(const LVTypeImport &)=delete
bool equals(const LVType *Type) const override
LVTypeImport()
Definition LVType.h:206
LVTypeParam(const LVTypeParam &)=delete
size_t getValueIndex() const override
Definition LVType.h:235
~LVTypeParam() override=default
void setValue(StringRef Value) override
Definition LVType.h:232
LVTypeParam & operator=(const LVTypeParam &)=delete
StringRef getValue() const override
Definition LVType.h:229
LVTypeSubrange()
Definition LVType.h:253
LVTypeSubrange & operator=(const LVTypeSubrange &)=delete
LVTypeSubrange(const LVTypeSubrange &)=delete
void setLowerBound(int64_t Value) override
Definition LVType.h:270
void setUpperBound(int64_t Value) override
Definition LVType.h:273
void setBounds(unsigned Lower, unsigned Upper) override
Definition LVType.h:278
std::pair< unsigned, unsigned > getBounds() const override
Definition LVType.h:275
int64_t getUpperBound() const override
Definition LVType.h:272
~LVTypeSubrange() override=default
void setCount(int64_t Value) override
Definition LVType.h:264
int64_t getCount() const override
Definition LVType.h:261
int64_t getLowerBound() const override
Definition LVType.h:269
~LVType() override=default
KIND(LVTypeKind, IsRvalueReference)
KIND(LVTypeKind, IsTemplateParam)
KIND_1(LVTypeKind, IsImportModule, IsImport)
KIND(LVTypeKind, IsEnumerator)
KIND(LVTypeKind, IsUnspecified)
KIND(LVTypeKind, IsRestrict)
KIND(LVTypeKind, IsConst)
LVType(const LVType &)=delete
void setBitSize(uint32_t Size) override
Definition LVType.h:118
KIND(LVTypeKind, IsTypedef)
KIND(LVTypeKind, IsReference)
static LVTypeDispatch & getDispatch()
Definition LVType.h:123
KIND(LVTypeKind, IsPointer)
KIND_1(LVTypeKind, IsImportDeclaration, IsImport)
StringRef resolveReferencesChain()
PROPERTY(Property, IsSubrangeCount)
KIND(LVTypeKind, IsVolatile)
LVType & operator=(const LVType &)=delete
uint32_t getBitSize() const override
Definition LVType.h:117
bool isBase() const override
Definition LVType.h:106
LVType()
Definition LVType.h:67
KIND(LVTypeKind, IsModifier)
KIND(LVTypeKind, IsImport)
virtual void encodeTemplateArgument(std::string &Name) const
Definition LVType.h:110
const char * kind() const override
virtual void setUnderlyingType(LVElement *Element)
Definition LVType.h:114
KIND_1(LVTypeKind, IsTemplateTemplateParam, IsTemplateParam)
virtual LVElement * getUnderlyingType()
Definition LVType.h:113
KIND(LVTypeKind, IsPointerMember)
KIND(LVTypeKind, IsUnaligned)
bool isTemplateParam() const override
Definition LVType.h:107
static bool classof(const LVElement *Element)
Definition LVType.h:72
KIND(LVTypeKind, IsSubrange)
KIND_1(LVTypeKind, IsTemplateValueParam, IsTemplateParam)
KIND_1(LVTypeKind, IsTemplateTypeParam, IsTemplateParam)
This class implements an extremely fast bulk output stream that can only output to a stream.
LLVM_ABI LVStringPool & getStringPool()
LVTypeKind
Definition LVType.h:23
@ IsTypedef
Definition LVType.h:40
@ IsPointer
Definition LVType.h:30
@ IsBase
Definition LVType.h:24
@ IsTemplateTypeParam
Definition LVType.h:38
@ IsTemplateTemplateParam
Definition LVType.h:37
@ IsPointerMember
Definition LVType.h:31
@ IsModifier
Definition LVType.h:44
@ IsTemplateParam
Definition LVType.h:36
@ IsSubrange
Definition LVType.h:35
@ IsVolatile
Definition LVType.h:43
@ IsConst
Definition LVType.h:25
@ IsTemplateValueParam
Definition LVType.h:39
@ IsImport
Definition LVType.h:27
@ IsImportDeclaration
Definition LVType.h:28
@ IsUnaligned
Definition LVType.h:41
@ IsReference
Definition LVType.h:32
@ IsRestrict
Definition LVType.h:33
@ IsEnumerator
Definition LVType.h:26
@ IsImportModule
Definition LVType.h:29
@ IsRvalueReference
Definition LVType.h:34
std::map< LVTypeKind, LVTypeGetFunction > LVTypeDispatch
Definition LVType.h:48
SmallVector< LVScope *, 8 > LVScopes
std::vector< LVTypeGetFunction > LVTypeRequest
Definition LVType.h:49
std::set< LVTypeKind > LVTypeKindSelection
Definition LVType.h:47
SmallVector< LVType *, 8 > LVTypes
This is an optimization pass for GlobalISel generic memory operations.