14#ifndef LLVM_ABI_TYPES_H
15#define LLVM_ABI_TYPES_H
46 TypeSize StoreSizeInBits = getTypeStoreSizeInBits();
50 TypeSize getTypeStoreSizeInBits()
const {
54 return {AlignedSizeInBits, BaseSize.
isScalable()};
97 ElementType(ElementType) {}
106 const Type *ElementType;
116 bool IsBitInt =
false)
118 IsSigned(IsSigned), IsBitInt(IsBitInt) {}
140 Semantics(&FloatSemantics) {}
175 bool IsFunctionPointer;
182 IsFunctionPointer(IsFunctionPointer) {}
192 const Type *ElementType;
198 bool IsMatrixType =
false)
201 ElementType(ElementType), NumElements(NumElements),
202 IsMatrix(IsMatrixType) {}
213 const Type *ElementType;
220 NumElements.getKnownMinValue(),
221 NumElements.isScalable()),
223 ElementType(ElementType), NumElements(NumElements) {}
242 bool IsUnnamedBitField =
false)
277 BaseClasses(Bases), VirtualBaseClasses(VBases), Packing(Pack),
300 return VirtualBaseClasses.size();
308 return VirtualBaseClasses;
340 bool IsBitInt =
false) {
350 unsigned Addrspace = 0) {
357 bool IsMatrixType =
false) {
358 return new (Allocator.Allocate<
ArrayType>())
359 ArrayType(ElementType, NumElements, SizeInBits, IsMatrixType);
374 FieldInfo *FieldArray =
Allocator.Allocate<FieldInfo>(Fields.
size());
375 std::copy(Fields.
begin(), Fields.
end(), FieldArray);
377 FieldInfo *BaseArray =
nullptr;
378 if (!BaseClasses.empty()) {
379 BaseArray =
Allocator.Allocate<FieldInfo>(BaseClasses.size());
380 std::copy(BaseClasses.begin(), BaseClasses.end(), BaseArray);
383 FieldInfo *VBaseArray =
nullptr;
384 if (!VirtualBaseClasses.
empty()) {
385 VBaseArray =
Allocator.Allocate<FieldInfo>(VirtualBaseClasses.
size());
386 std::copy(VirtualBaseClasses.
begin(), VirtualBaseClasses.
end(),
395 RecordType(FieldsRef, BasesRef, VBasesRef,
Size, Align, Pack, RecFlags);
404 for (
size_t I = 0,
E = Fields.
size();
I !=
E; ++
I) {
408 Field.IsUnnamedBitfield);
420 uint64_t ElementSizeInBits = ElementType->getSizeInBits().getFixedValue();
421 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
static bool classof(const Type *T)
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.
constexpr 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)