LLVM 22.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 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)
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:326
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Definition Allocator.h:383
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39

Definition at line 321 of file Types.h.

Constructor & Destructor Documentation

◆ TypeBuilder()

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

Definition at line 326 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 348 of file Types.h.

◆ getComplexType()

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

Definition at line 411 of file Types.h.

◆ getFloatType()

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

Definition at line 338 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 332 of file Types.h.

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

◆ getMemberPointerType()

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

Definition at line 420 of file Types.h.

◆ getPointerType()

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

Definition at line 342 of file Types.h.

References Size.

◆ 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 361 of file Types.h.

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

◆ 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 )
inline

Definition at line 355 of file Types.h.

◆ getVoidType()

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

Definition at line 328 of file Types.h.


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