14#ifndef LLVM_ABI_TYPES_H
15#define LLVM_ABI_TYPES_H
48 TypeSize StoreSizeInBits = getTypeStoreSizeInBits();
52 TypeSize getTypeStoreSizeInBits()
const {
56 return {AlignedSizeInBits, BaseSize.
isScalable()};
98 ElementType(ElementType) {}
107 const Type *ElementType;
117 bool IsBitInt =
false)
119 IsSigned(IsSigned), IsBitInt(IsBitInt) {}
141 Semantics(&FloatSemantics) {}
176 bool IsFunctionPointer;
183 IsFunctionPointer(IsFunctionPointer) {}
193 const Type *ElementType;
199 bool IsMatrixType =
false)
202 ElementType(ElementType), NumElements(NumElements),
203 IsMatrix(IsMatrixType) {}
214 const Type *ElementType;
221 NumElements.getKnownMinValue(),
222 NumElements.isScalable()),
224 ElementType(ElementType), NumElements(NumElements) {}
243 bool IsUnnamedBitField =
false)
276 BaseClasses(Bases), VirtualBaseClasses(VBases), Packing(Pack),
299 return VirtualBaseClasses.size();
307 return VirtualBaseClasses;
333 bool IsBitInt =
false) {
343 unsigned Addrspace = 0) {
350 bool IsMatrixType =
false) {
351 return new (Allocator.Allocate<
ArrayType>())
352 ArrayType(ElementType, NumElements, SizeInBits, IsMatrixType);
367 FieldInfo *FieldArray =
Allocator.Allocate<FieldInfo>(Fields.
size());
368 std::copy(Fields.
begin(), Fields.
end(), FieldArray);
370 FieldInfo *BaseArray =
nullptr;
371 if (!BaseClasses.empty()) {
372 BaseArray =
Allocator.Allocate<FieldInfo>(BaseClasses.size());
373 std::copy(BaseClasses.begin(), BaseClasses.end(), BaseArray);
376 FieldInfo *VBaseArray =
nullptr;
377 if (!VirtualBaseClasses.
empty()) {
378 VBaseArray =
Allocator.Allocate<FieldInfo>(VirtualBaseClasses.
size());
379 std::copy(VirtualBaseClasses.
begin(), VirtualBaseClasses.
end(),
388 RecordType(FieldsRef, BasesRef, VBasesRef,
Size, Align, Pack, RecFlags);
397 for (
size_t I = 0,
E = Fields.
size();
I !=
E; ++
I) {
401 Field.IsUnnamedBitfield);
413 uint64_t ElementSizeInBits = ElementType->getSizeInBits().getFixedValue();
414 uint64_t ComplexSizeInBits = ElementSizeInBits * 2;
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This file defines the BumpPtrAllocator interface.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
OptimizedStructLayoutField Field
FunctionLoweringInfo::StatepointRelocationRecord RecordType
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
const Type * getElementType() const
bool isMatrixType() const
static bool classof(const Type *T)
ArrayType(const Type *ElementType, uint64_t NumElements, uint64_t SizeInBits, bool IsMatrixType=false)
uint64_t getNumElements() const
ComplexType(const Type *ElementType, uint64_t SizeInBits, Align Alignment)
const Type * getElementType() const
static bool classof(const Type *T)
FloatType(const fltSemantics &FloatSemantics, Align ABIAlign)
const fltSemantics * getSemantics() const
static bool classof(const Type *T)
static bool classof(const Type *T)
IntegerType(uint64_t BitWidth, Align ABIAlign, bool IsSigned, bool IsBitInt=false)
bool isFunctionPointer() const
static bool classof(const Type *T)
MemberPointerType(bool IsFunctionPointer, uint64_t SizeInBits, Align ABIAlign, unsigned AddressSpace=0)
PointerLikeType(TypeKind K, TypeSize SizeInBits, Align ABIAlign, unsigned AS)
static bool classof(const Type *T)
bool isMemberPointer() const
unsigned getAddrSpace() const
PointerType(uint64_t Size, Align ABIAlign, unsigned AddressSpace=0)
static bool classof(const Type *T)
bool isPolymorphic() const
bool canPassInRegisters() const
ArrayRef< FieldInfo > getBaseClasses() const
uint32_t getNumBaseClasses() const
ArrayRef< FieldInfo > getFields() const
uint32_t getNumVirtualBaseClasses() const
bool hasFlexibleArrayMember() const
bool isTransparentUnion() const
RecordType(ArrayRef< FieldInfo > StructFields, ArrayRef< FieldInfo > Bases, ArrayRef< FieldInfo > VBases, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, RecordFlags RecFlags=RecordFlags::None)
uint32_t getNumFields() const
ArrayRef< FieldInfo > getVirtualBaseClasses() const
StructPacking getPacking() const
const ComplexType * getComplexType(const Type *ElementType, Align Align)
const FloatType * getFloatType(const fltSemantics &Semantics, Align Align)
const IntegerType * getIntegerType(uint64_t BitWidth, Align Align, bool Signed, bool IsBitInt=false)
const MemberPointerType * getMemberPointerType(bool IsFunctionPointer, uint64_t SizeInBits, Align Align)
const RecordType * getRecordType(ArrayRef< FieldInfo > Fields, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, ArrayRef< FieldInfo > BaseClasses={}, ArrayRef< FieldInfo > VirtualBaseClasses={}, RecordFlags RecFlags=RecordFlags::None)
TypeBuilder(BumpPtrAllocator &Alloc)
const ArrayType * getArrayType(const Type *ElementType, uint64_t NumElements, uint64_t SizeInBits, bool IsMatrixType=false)
const PointerType * getPointerType(uint64_t Size, Align Align, unsigned Addrspace=0)
const VoidType * getVoidType()
const RecordType * getUnionType(ArrayRef< FieldInfo > Fields, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, RecordFlags RecFlags=RecordFlags::None)
const VectorType * getVectorType(const Type *ElementType, ElementCount NumElements, Align Align)
Represents the ABI-specific view of a type in LLVM.
TypeSize getTypeAllocSize() const
bool isMemberPointer() const
TypeSize getSizeInBits() const
Type(TypeKind K, TypeSize SizeInBits, Align ABIAlign)
Align getAlignment() const
ElementCount getNumElements() const
const Type * getElementType() const
static bool classof(const Type *T)
VectorType(const Type *ElementType, ElementCount NumElements, Align ABIAlign)
static bool classof(const Type *T)
constexpr ScalarTy getFixedValue() const
constexpr bool isScalable() const
Returns whether the quantity is scaled by a runtime quantity (vscale).
constexpr ScalarTy getKnownMinValue() const
Returns the minimum value this quantity can represent.
@ LLVM_MARK_AS_BITMASK_ENUM
This is an optimization pass for GlobalISel generic memory operations.
constexpr T alignToPowerOf2(U Value, V Align)
Will overflow only if result is not representable in T.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
This struct is a compact representation of a valid (non-zero power of two) alignment.
FieldInfo(const Type *FieldType, uint64_t OffsetInBits=0, bool IsBitField=false, uint64_t BitFieldWidth=0, bool IsUnnamedBitField=false)