LLVM: include/llvm/SandboxIR/Type.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_SANDBOXIR_TYPE_H
14#define LLVM_SANDBOXIR_TYPE_H
15
22
24
26
39class TargetExtType;
41#define DEF_INSTR(ID, OPCODE, CLASS) class CLASS;
42#define DEF_CONST(ID, CLASS) class CLASS;
43#include "llvm/SandboxIR/Values.def"
44
45
46
48protected:
65
71
72
73#define DEF_INSTR(ID, OPCODE, CLASS) friend class CLASS;
74#define DEF_CONST(ID, CLASS) friend class CLASS;
75#include "llvm/SandboxIR/Values.def"
77
81
82public:
83
84
85
86
87
88
90 bool NoDetails = false) const {
91 LLVMTy->print(OS, IsForDebug, NoDetails);
92 }
93
95
96
98
99
101
102
104
105
107
108
110
111
113
114
116
117
119
120
122
123
124
125
127
128
130
131
132
133
134
136
138 return LLVMTy->getFltSemantics();
139 }
140
141
143
144
146
147
149
150
152
153
155
156
158
159
161
162
164
165
167
168
170 return LLVMTy->isIntegerTy(Bitwidth);
171 }
172
173
175
176
177
181
182
184
185
187
188
190
191
193
194
196
197
199
200
202
203
204
205
206
208 return LLVMTy->canLosslesslyBitCastTo(Ty->LLVMTy);
209 }
210
211
212
214
215
216
218
219
220
222
223
224
225
227
228
229
230
233 LLVMVisited.reserve(Visited->size());
234 for (Type *Ty : *Visited)
235 LLVMVisited.insert(Ty->LLVMTy);
236 return LLVMTy->isSized(&LLVMVisited);
237 }
238
239
240
241
242
243
244
245
246
247
248
249
250
251
253 return LLVMTy->getPrimitiveSizeInBits();
254 }
255
256
257
258
260
261
262
263
265
266
267
269
270
271
280
281
282
284 return LLVMTy->getPointerAddressSpace();
285 }
286
287#ifndef NDEBUG
290#endif
291};
292
294public:
295
296
298
302};
303
312
314public:
315
317 bool IsPacked = false);
318
320
321
325};
326
328public:
331 bool Scalable) {
334 }
336
340
348 int NumSubdivs);
352
356};
357
359public:
361
365
369
373
378
380 int NumSubdivs) {
383 }
384
388
392
396
400};
401
403public:
405 unsigned MinNumElts);
406
411
415
421
427
429 int NumSubdivs) {
432 }
433
438
444
448
452};
453
461
462
463
464
465
477
478}
479
480#endif
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file defines the SmallPtrSet class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
Class to represent integer types.
void reserve(size_type NewNumEntries)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
The instances of the Type class are immutable: once they are created, they are never changed.
This class implements an extremely fast bulk output stream that can only output to a stream.
static bool classof(const Type *From)
Definition Type.h:308
static LLVM_ABI ArrayType * get(Type *ElementType, uint64_t NumElements)
ConstantDataSequential - A vector or array constant whose element type is a simple 1/2/4/8-byte integ...
static FixedVectorType * getExtendedElementVectorType(FixedVectorType *VTy)
Definition Type.h:370
unsigned getNumElements() const
Definition Type.h:397
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
static bool classof(const Type *T)
Definition Type.h:393
static FixedVectorType * getDoubleElementsVectorType(FixedVectorType *VTy)
Definition Type.h:389
static FixedVectorType * get(Type *ElementType, const FixedVectorType *FVTy)
Definition Type.h:362
static FixedVectorType * getHalfElementsVectorType(FixedVectorType *VTy)
Definition Type.h:385
static FixedVectorType * getSubdividedVectorType(FixedVectorType *VTy, int NumSubdivs)
Definition Type.h:379
static FixedVectorType * getTruncatedElementVectorType(FixedVectorType *VTy)
Definition Type.h:374
static FixedVectorType * getInteger(FixedVectorType *VTy)
Definition Type.h:366
static bool classof(const Type *From)
Definition Type.h:457
Class to represent integer types.
Definition Type.h:466
static LLVM_ABI IntegerType * get(Context &C, unsigned NumBits)
static bool classof(const Type *From)
Definition Type.h:470
In SandboxIR the Module is mainly used to access the list of global objects.
static bool classof(const Type *From)
Definition Type.h:299
static LLVM_ABI PointerType * get(Context &Ctx, unsigned AddressSpace)
static ScalableVectorType * getExtendedElementVectorType(ScalableVectorType *VTy)
Definition Type.h:417
static bool classof(const Type *T)
Definition Type.h:449
static ScalableVectorType * getInteger(ScalableVectorType *VTy)
Definition Type.h:412
static ScalableVectorType * getHalfElementsVectorType(ScalableVectorType *VTy)
Definition Type.h:435
unsigned getMinNumElements() const
Definition Type.h:445
static ScalableVectorType * getDoubleElementsVectorType(ScalableVectorType *VTy)
Definition Type.h:440
static ScalableVectorType * get(Type *ElementType, const ScalableVectorType *SVTy)
Definition Type.h:407
static ScalableVectorType * getSubdividedVectorType(ScalableVectorType *VTy, int NumSubdivs)
Definition Type.h:428
static ScalableVectorType * getTruncatedElementVectorType(ScalableVectorType *VTy)
Definition Type.h:423
static LLVM_ABI ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
static bool classof(const Type *From)
Definition Type.h:322
bool isPacked() const
Definition Type.h:319
static LLVM_ABI StructType * get(Context &Ctx, ArrayRef< Type * > Elements, bool IsPacked=false)
This static method is the primary way to create a literal StructType.
Just like llvm::Type these are immutable, unique, never get freed and can only be created via static ...
Definition Type.h:47
bool isX86_FP80Ty() const
Return true if this is x86 long double.
Definition Type.h:115
bool isScalableTy() const
Return true if this is a type whose size is a known multiple of vscale.
Definition Type.h:151
bool isFP128Ty() const
Return true if this is 'fp128'.
Definition Type.h:118
static LLVM_ABI Type * getHalfTy(Context &Ctx)
friend class ConstantStruct
Definition Type.h:62
friend class ConstantVector
Definition Type.h:63
const fltSemantics & getFltSemantics() const
Definition Type.h:137
friend class FPMathOperator
Definition Type.h:69
friend class Module
Definition Type.h:68
bool isIntOrPtrTy() const
Return true if this is an integer type or a pointer type.
Definition Type.h:183
bool isTargetExtTy() const
Return true if this is a target extension type.
Definition Type.h:145
llvm::Type * LLVMTy
Definition Type.h:49
bool isIEEELikeFPTy() const
Return true if this is a well-behaved IEEE-like type, which has a IEEE compatible layout,...
Definition Type.h:126
Type(llvm::Type *LLVMTy, Context &Ctx)
Definition Type.h:78
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
Definition Type.h:129
bool canLosslesslyBitCastTo(Type *Ty) const
Return true if this type could be converted with a lossless BitCast to type 'Ty'.
Definition Type.h:207
friend class TargetExtType
Definition Type.h:67
friend class CmpInst
Definition Type.h:64
bool isMetadataTy() const
Return true if this is 'metadata'.
Definition Type.h:160
static LLVM_ABI Type * getInt8Ty(Context &Ctx)
static LLVM_ABI Type * getDoubleTy(Context &Ctx)
TypeSize getPrimitiveSizeInBits() const
Return the basic size of this type if it is a primitive type.
Definition Type.h:252
friend class ArrayType
Definition Type.h:50
bool isIntegerTy() const
True if this is an instance of IntegerType.
Definition Type.h:166
void print(raw_ostream &OS, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
Definition Type.h:89
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
Definition Type.h:174
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
Definition Type.h:154
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Definition Type.h:283
bool isHalfTy() const
Return true if this is 'half', a 16-bit IEEE fp type.
Definition Type.h:100
bool isStructTy() const
True if this is an instance of StructType.
Definition Type.h:189
bool isX86_AMXTy() const
Return true if this is X86 AMX.
Definition Type.h:142
bool isDoubleTy() const
Return true if this is 'double', a 64-bit IEEE fp type.
Definition Type.h:112
unsigned getScalarSizeInBits() const
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
Definition Type.h:259
friend class ConstantDataSequential
Definition Type.h:70
bool is16bitFPTy() const
Return true if this is a 16-bit float type.
Definition Type.h:106
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
Definition Type.h:231
static LLVM_ABI Type * getInt1Ty(Context &Ctx)
friend class FixedVectorType
Definition Type.h:53
bool isPtrOrPtrVectorTy() const
Return true if this is a pointer type or a vector of pointer types.
Definition Type.h:198
friend class VectorType
Definition Type.h:52
friend class FunctionType
Definition Type.h:56
static LLVM_ABI Type * getInt32Ty(Context &Ctx)
bool isArrayTy() const
True if this is an instance of ArrayType.
Definition Type.h:192
bool isPPC_FP128Ty() const
Return true if this is powerpc long double.
Definition Type.h:121
LLVM_ABI Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool isSingleValueType() const
Return true if the type is a valid type for a register in codegen.
Definition Type.h:221
LLVM_DUMP_METHOD void dump()
static LLVM_ABI Type * getInt64Ty(Context &Ctx)
bool isTokenTy() const
Return true if this is 'token'.
Definition Type.h:163
bool isVoidTy() const
Return true if this is 'void'.
Definition Type.h:97
friend class IntegerType
Definition Type.h:57
int getFPMantissaWidth() const
Return the width of the mantissa of this type.
Definition Type.h:264
bool isFunctionTy() const
True if this is an instance of FunctionType.
Definition Type.h:186
friend class ConstantArray
Definition Type.h:61
bool isScalableTargetExtTy() const
Return true if this is a target extension type with a scalable layout.
Definition Type.h:148
void dumpOS(raw_ostream &OS)
friend class Function
Definition Type.h:58
bool isVectorTy() const
True if this is an instance of VectorType.
Definition Type.h:201
bool isMultiUnitFPType() const
Returns true if this is a floating-point type that is an unevaluated sum of multiple floating-point u...
Definition Type.h:135
friend class CallBase
Definition Type.h:59
bool isEmptyTy() const
Return true if this type is empty, that is, it has no elements or all of its elements are empty.
Definition Type.h:213
friend class PointerType
Definition Type.h:55
friend class Utils
Definition Type.h:66
bool isPointerTy() const
True if this is an instance of PointerType.
Definition Type.h:195
friend class Context
Definition Type.h:79
bool isFloatTy() const
Return true if this is 'float', a 32-bit IEEE fp type.
Definition Type.h:109
bool isIntegerTy(unsigned Bitwidth) const
Return true if this is an IntegerType of the given width.
Definition Type.h:169
bool isAggregateType() const
Return true if the type is an aggregate type.
Definition Type.h:226
bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
Definition Type.h:217
friend class ScalableVectorType
Definition Type.h:54
friend class ConstantInt
Definition Type.h:60
friend class StructType
Definition Type.h:51
Context & Ctx
Definition Type.h:76
Context & getContext() const
Definition Type.h:94
bool isLabelTy() const
Return true if this is 'label'.
Definition Type.h:157
static LLVM_ABI Type * getFloatTy(Context &Ctx)
static LLVM_ABI Type * getInt16Ty(Context &Ctx)
bool isBFloatTy() const
Return true if this is 'bfloat', a 16-bit bfloat type.
Definition Type.h:103
bool isIntOrIntVectorTy(unsigned BitWidth) const
Return true if this is an integer type or a vector of integer types of the given width.
Definition Type.h:178
static LLVM_ABI bool isValidElementType(Type *ElemTy)
ElementCount getElementCount() const
Definition Type.h:341
static LLVM_ABI VectorType * getSubdividedVectorType(VectorType *VTy, int NumSubdivs)
static VectorType * get(Type *ElementType, const VectorType *Other)
Definition Type.h:337
static bool classof(const Type *From)
Definition Type.h:353
static VectorType * get(Type *ElementType, unsigned NumElements, bool Scalable)
Definition Type.h:330
static LLVM_ABI VectorType * getInteger(VectorType *VTy)
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
static LLVM_ABI VectorType * getTruncatedElementVectorType(VectorType *VTy)
static LLVM_ABI VectorType * getDoubleElementsVectorType(VectorType *VTy)
static LLVM_ABI VectorType * getHalfElementsVectorType(VectorType *VTy)
static LLVM_ABI VectorType * getExtendedElementVectorType(VectorType *VTy)
LLVM_ABI Type * getElementType() const
@ C
The default llvm calling convention, compatible with C.
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.