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
18
19namespace llvm {
20namespace logicalview {
21
45};
47using LVTypeDispatch = std::map<LVTypeKind, LVTypeGetFunction>;
49
50
52 enum class Property { IsSubrangeCount, LastEntry };
53
54
58
59
61
62public:
67
70 }
71
93
95
96 const char *kind() const override;
97
98
99
101
102 bool isBase() const override { return getIsBase(); }
103 bool isTemplateParam() const override { return getIsTemplateParam(); }
104
105
107
108
111
114
116
119
122
123
124
125
128
129
131
132
133
135
136
138
141
142#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
144#endif
145};
146
147
149public:
151 setIsTypedef();
152 setIncludeInPrint();
153 }
157
158
161
163
164
166
168};
169
170
172
173 size_t ValueIndex = 0;
174
175public:
177 setIsEnumerator();
178 setIncludeInPrint();
179 }
183
184
187 }
190 }
192
193
195
197};
198
199
201public:
206
207
209
211};
212
213
215
216 size_t ValueIndex = 0;
217
218public:
223
224
227 }
230 }
232
233
235
236
238
240};
241
242
244
245 int64_t LowerBound = 0;
246 int64_t UpperBound = 0;
247
248public:
250 setIsSubrange();
251 setIncludeInPrint();
252 }
256
258 return getIsSubrangeCount() ? LowerBound : 0;
259 }
261 LowerBound = Value;
262 setIsSubrangeCount();
263 }
264
265 int64_t getLowerBound() const override { return LowerBound; }
267
268 int64_t getUpperBound() const override { return UpperBound; }
270
271 std::pair<unsigned, unsigned> getBounds() const override {
272 return {LowerBound, UpperBound};
273 }
275 LowerBound = Lower;
276 UpperBound = Upper;
277 }
278
280
281
283
285};
286
287}
288}
289
290#endif
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.
void setType(LVElement *Element=nullptr)
LVSubclassID getSubclassID() const
StringRef getString(size_t Index) const
size_t getIndex(StringRef Key)
~LVTypeDefinition()=default
void setUnderlyingType(LVElement *Element) override
bool equals(const LVType *Type) const override
LVTypeDefinition & operator=(const LVTypeDefinition &)=delete
void resolveExtra() override
LVTypeDefinition(const LVTypeDefinition &)=delete
void printExtra(raw_ostream &OS, bool Full=true) const override
LVElement * getUnderlyingType() override
size_t getValueIndex() const override
void setValue(StringRef Value) override
LVTypeEnumerator(const LVTypeEnumerator &)=delete
void printExtra(raw_ostream &OS, bool Full=true) const override
StringRef getValue() const override
~LVTypeEnumerator()=default
LVTypeEnumerator & operator=(const LVTypeEnumerator &)=delete
bool equals(const LVType *Type) const override
LVTypeImport(const LVTypeImport &)=delete
void printExtra(raw_ostream &OS, bool Full=true) const override
LVTypeImport & operator=(const LVTypeImport &)=delete
bool equals(const LVType *Type) const override
LVTypeParam(const LVTypeParam &)=delete
size_t getValueIndex() const override
void setValue(StringRef Value) override
void printExtra(raw_ostream &OS, bool Full=true) const override
void encodeTemplateArgument(std::string &Name) const override
bool equals(const LVType *Type) const override
LVTypeParam & operator=(const LVTypeParam &)=delete
StringRef getValue() const override
~LVTypeSubrange()=default
LVTypeSubrange & operator=(const LVTypeSubrange &)=delete
void resolveExtra() override
LVTypeSubrange(const LVTypeSubrange &)=delete
void setLowerBound(int64_t Value) override
void setUpperBound(int64_t Value) override
void setBounds(unsigned Lower, unsigned Upper) override
std::pair< unsigned, unsigned > getBounds() const override
int64_t getUpperBound() const override
void printExtra(raw_ostream &OS, bool Full=true) const override
void setCount(int64_t Value) override
int64_t getCount() const override
bool equals(const LVType *Type) const override
int64_t getLowerBound() const override
void resolveReferences() override
KIND(LVTypeKind, IsRvalueReference)
KIND(LVTypeKind, IsTemplateParam)
KIND_1(LVTypeKind, IsImportModule, IsImport)
KIND(LVTypeKind, IsEnumerator)
virtual ~LVType()=default
virtual bool equals(const LVType *Type) const
void report(LVComparePass Pass) override
KIND(LVTypeKind, IsUnspecified)
KIND(LVTypeKind, IsRestrict)
KIND(LVTypeKind, IsConst)
LVType(const LVType &)=delete
KIND(LVTypeKind, IsTypedef)
void printExtra(raw_ostream &OS, bool Full=true) const override
KIND(LVTypeKind, IsReference)
static bool parametersMatch(const LVTypes *References, const LVTypes *Targets)
static LVTypeDispatch & getDispatch()
KIND(LVTypeKind, IsPointer)
KIND_1(LVTypeKind, IsImportDeclaration, IsImport)
StringRef resolveReferencesChain()
PROPERTY(Property, IsSubrangeCount)
KIND(LVTypeKind, IsVolatile)
LVType & operator=(const LVType &)=delete
void resolveName() override
bool isBase() const override
KIND(LVTypeKind, IsModifier)
void dump() const override
KIND(LVTypeKind, IsImport)
virtual void encodeTemplateArgument(std::string &Name) const
const char * kind() const override
static void getParameters(const LVTypes *Types, LVTypes *TypesParam, LVScopes *ScopesParam)
virtual void setUnderlyingType(LVElement *Element)
KIND_1(LVTypeKind, IsTemplateTemplateParam, IsTemplateParam)
virtual LVElement * getUnderlyingType()
KIND(LVTypeKind, IsPointerMember)
KIND(LVTypeKind, IsUnaligned)
void print(raw_ostream &OS, bool Full=true) const override
bool isTemplateParam() const override
static void markMissingParents(const LVTypes *References, const LVTypes *Targets)
static bool classof(const LVElement *Element)
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.
LVStringPool & getStringPool()
std::set< LVTypeKind > LVTypeKindSelection
@ IsTemplateTemplateParam
std::map< LVTypeKind, LVTypeGetFunction > LVTypeDispatch
std::vector< LVTypeGetFunction > LVTypeRequest
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.