LLVM 24.0.0git
llvm::abi::TypeBuilder Class Reference

TypeBuilder manages the lifecycle of ABI types using bump pointer allocation. More...

#include "llvm/ABI/Types.h"

Public Member Functions

 TypeBuilder (BumpPtrAllocator &Alloc)
const VoidTypegetVoidType ()
const AtomicTypegetAtomicType (const Type *ValueType, uint64_t SizeInBits, Align Align)
const IntegerTypegetIntegerType (uint64_t BitWidth, Align Align, bool Signed, bool IsBitInt=false)
const FloatTypegetFloatType (const fltSemantics &Semantics, Align Align)
const PointerTypegetPointerType (uint64_t Size, Align Align, unsigned Addrspace=0)
const ArrayTypegetArrayType (const Type *ElementType, uint64_t NumElements, uint64_t SizeInBits, bool IsMatrixType=false)
const VectorTypegetVectorType (const Type *ElementType, ElementCount NumElements, Align Align, VectorKind VecKind=VectorKind::Generic)
const TupleTypegetTupleType (const VectorType *Vec, unsigned NumVectors)
 Creates a homogeneous tuple of NumVectors copies of Vec.
const VectorTypegetSVECountType (Align ABIAlign)
 Creates the AArch64 __SVCount_t type.
const RecordTypegetRecordType (ArrayRef< FieldInfo > Fields, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, ArrayRef< FieldInfo > BaseClasses={}, ArrayRef< FieldInfo > VirtualBaseClasses={}, RecordFlags RecFlags=RecordFlags::None)
const RecordTypegetUnionType (ArrayRef< FieldInfo > Fields, TypeSize Size, Align Align, StructPacking Pack=StructPacking::Default, RecordFlags RecFlags=RecordFlags::None)
const ComplexTypegetComplexType (const Type *ElementType, Align Align)
const MemberPointerTypegetMemberPointerType (bool IsFunctionPointer, uint64_t SizeInBits, Align Align)

Detailed Description

TypeBuilder manages the lifecycle of ABI types using bump pointer allocation.

Types created by a TypeBuilder are valid for the lifetime of the allocator.

Example usage:

TypeBuilder Builder(Alloc);
const auto *IntTy = Builder.getIntegerType(32, Align(4), true);
TypeBuilder(BumpPtrAllocator &Alloc)
Definition Types.h:428
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:390
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39

Definition at line 423 of file Types.h.

Constructor & Destructor Documentation

◆ TypeBuilder()

llvm::abi::TypeBuilder::TypeBuilder ( BumpPtrAllocator & Alloc)
inlineexplicit

Definition at line 428 of file Types.h.

References llvm::Alloc.

Member Function Documentation

◆ getArrayType()

const ArrayType * llvm::abi::TypeBuilder::getArrayType ( const Type * ElementType,
uint64_t NumElements,
uint64_t SizeInBits,
bool IsMatrixType = false )
inline

Definition at line 456 of file Types.h.

References uint64_t.

◆ getAtomicType()

const AtomicType * llvm::abi::TypeBuilder::getAtomicType ( const Type * ValueType,
uint64_t SizeInBits,
Align Align )
inline

Definition at line 434 of file Types.h.

References uint64_t.

◆ getComplexType()

const ComplexType * llvm::abi::TypeBuilder::getComplexType ( const Type * ElementType,
Align Align )
inline

Definition at line 537 of file Types.h.

References uint64_t.

◆ getFloatType()

const FloatType * llvm::abi::TypeBuilder::getFloatType ( const fltSemantics & Semantics,
Align Align )
inline

Definition at line 446 of file Types.h.

◆ getIntegerType()

const IntegerType * llvm::abi::TypeBuilder::getIntegerType ( uint64_t BitWidth,
Align Align,
bool Signed,
bool IsBitInt = false )
inline

Definition at line 440 of file Types.h.

References llvm::BitWidth, llvm::Signed, and uint64_t.

Referenced by getSVECountType().

◆ getMemberPointerType()

const MemberPointerType * llvm::abi::TypeBuilder::getMemberPointerType ( bool IsFunctionPointer,
uint64_t SizeInBits,
Align Align )
inline

Definition at line 546 of file Types.h.

References uint64_t.

◆ getPointerType()

const PointerType * llvm::abi::TypeBuilder::getPointerType ( uint64_t Size,
Align Align,
unsigned Addrspace = 0 )
inline

Definition at line 450 of file Types.h.

References Size, and uint64_t.

◆ getRecordType()

const RecordType * llvm::abi::TypeBuilder::getRecordType ( ArrayRef< FieldInfo > Fields,
TypeSize Size,
Align Align,
StructPacking Pack = StructPacking::Default,
ArrayRef< FieldInfo > BaseClasses = {},
ArrayRef< FieldInfo > VirtualBaseClasses = {},
RecordFlags RecFlags = RecordFlags::None )
inline

Definition at line 488 of file Types.h.

References llvm::abi::Default, and Size.

◆ getSVECountType()

const VectorType * llvm::abi::TypeBuilder::getSVECountType ( Align ABIAlign)
inline

Creates the AArch64 __SVCount_t type.

The type is opaque, so it is modeled with the shape of svbool_t: a scalable vector of 16 one-bit elements.

Definition at line 481 of file Types.h.

References getIntegerType(), llvm::ElementCount::getScalable(), getVectorType(), and llvm::abi::SVECount.

◆ getTupleType()

const TupleType * llvm::abi::TypeBuilder::getTupleType ( const VectorType * Vec,
unsigned NumVectors )
inline

Creates a homogeneous tuple of NumVectors copies of Vec.

NumVectors must be 2, 3, or 4.

Definition at line 472 of file Types.h.

References assert().

◆ getUnionType()

const RecordType * llvm::abi::TypeBuilder::getUnionType ( ArrayRef< FieldInfo > Fields,
TypeSize Size,
Align Align,
StructPacking Pack = StructPacking::Default,
RecordFlags RecFlags = RecordFlags::None )
inline

◆ getVectorType()

const VectorType * llvm::abi::TypeBuilder::getVectorType ( const Type * ElementType,
ElementCount NumElements,
Align Align,
VectorKind VecKind = VectorKind::Generic )
inline

Definition at line 463 of file Types.h.

References llvm::abi::Generic.

Referenced by getSVECountType().

◆ getVoidType()

const VoidType * llvm::abi::TypeBuilder::getVoidType ( )
inline

Definition at line 430 of file Types.h.


The documentation for this class was generated from the following file: