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

Represents the ABI-specific view of a type in LLVM. More...

#include "llvm/ABI/Types.h"

Inheritance diagram for llvm::abi::Type:
[legend]

Public Member Functions

TypeKind getKind () const
TypeSize getSizeInBits () const
uint64_t getFixedSizeInBitsOrZero () const
 Returns the size in bits if it is fixed, otherwise 0.
LLVM_ABI uint64_t getABISizeInBits () const
 Returns the size in bits that the source language gives this type, including any padding.
Align getAlignment () const
Align getUnadjustedAlignment () const
 Alignment before record-level adjustments such as aligned attributes.
TypeSize getTypeAllocSize () const
bool isVoid () const
bool isAtomic () const
bool isInteger () const
bool isFloat () const
bool isPointer () const
bool isArray () const
bool isVector () const
bool isTuple () const
bool isRecord () const
bool isMemberPointer () const
bool isComplex () const
bool isZeroSize () const
LLVM_ABI bool isSVESizelessType () const
LLVM_ABI bool isEmptyRecord () const
 True if this type is a record that is empty for ABI purposes.

Protected Member Functions

 Type (TypeKind K, TypeSize SizeInBits, Align ABIAlign)
 Type (TypeKind K, TypeSize SizeInBits, Align ABIAlign, Align UnadjustedAlign)

Protected Attributes

TypeKind Kind
TypeSize SizeInBits
Align ABIAlignment
Align UnadjustedAlignment

Detailed Description

Represents the ABI-specific view of a type in LLVM.

This abstracts platform and language-specific ABI details from the frontend, providing a consistent interface for the ABI Library.

Definition at line 47 of file Types.h.

Constructor & Destructor Documentation

◆ Type() [1/2]

◆ Type() [2/2]

llvm::abi::Type::Type ( TypeKind K,
TypeSize SizeInBits,
Align ABIAlign,
Align UnadjustedAlign )
inlineprotected

Definition at line 69 of file Types.h.

References ABIAlignment, Kind, SizeInBits, and UnadjustedAlignment.

Member Function Documentation

◆ getABISizeInBits()

uint64_t llvm::abi::Type::getABISizeInBits ( ) const

Returns the size in bits that the source language gives this type, including any padding.

An integer is rounded up to whole bytes. A _BitInt or a floating-point type is rounded up further, to its alignment. That alignment must be the one its size is padded to, not one an aligned attribute raised or lowered. A complex type is twice the ABI size of its element type. A fixed-length vector counts an integer element other than a _BitInt at its bit width and every other element at its own ABI size, so a bool element takes one bit. The total is rounded up to a power of two of at least 8 bits. Any other type returns the size it was created with, and a scalable type returns 0.

Definition at line 18 of file Types.cpp.

References llvm::abi::Array, llvm::abi::Atomic, llvm::bit_ceil(), llvm::cast(), llvm::abi::Complex, llvm::dyn_cast(), llvm::abi::Float, getABISizeInBits(), getFixedSizeInBitsOrZero(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getFixedValue(), getKind(), getTypeAllocSize(), llvm::abi::Integer, IT, llvm_unreachable, llvm::abi::MemberPointer, llvm::abi::Pointer, llvm::abi::Record, llvm::abi::Tuple, Type(), llvm::abi::Vector, and llvm::abi::Void.

Referenced by llvm::abi::bitsContainNoUserData(), getABISizeInBits(), and llvm::abi::TargetInfo::isSingleElementStruct().

◆ getAlignment()

Align llvm::abi::Type::getAlignment ( ) const
inline

◆ getFixedSizeInBitsOrZero()

uint64_t llvm::abi::Type::getFixedSizeInBitsOrZero ( ) const
inline

Returns the size in bits if it is fixed, otherwise 0.

Definition at line 78 of file Types.h.

References SizeInBits, and uint64_t.

Referenced by getABISizeInBits().

◆ getKind()

TypeKind llvm::abi::Type::getKind ( ) const
inline

Definition at line 74 of file Types.h.

References Kind.

Referenced by getABISizeInBits(), llvm::abi::PointerLikeType::isMemberPointer(), and isSVESizelessType().

◆ getSizeInBits()

◆ getTypeAllocSize()

TypeSize llvm::abi::Type::getTypeAllocSize ( ) const
inline

Definition at line 102 of file Types.h.

References llvm::alignTo(), and getAlignment().

Referenced by getABISizeInBits().

◆ getUnadjustedAlignment()

Align llvm::abi::Type::getUnadjustedAlignment ( ) const
inline

Alignment before record-level adjustments such as aligned attributes.

Equal to getAlignment() unless a distinct unadjusted alignment was provided when the type was created.

Definition at line 100 of file Types.h.

References UnadjustedAlignment.

◆ isArray()

bool llvm::abi::Type::isArray ( ) const
inline

Definition at line 111 of file Types.h.

References llvm::abi::Array, and Kind.

◆ isAtomic()

bool llvm::abi::Type::isAtomic ( ) const
inline

Definition at line 107 of file Types.h.

References llvm::abi::Atomic, and Kind.

◆ isComplex()

bool llvm::abi::Type::isComplex ( ) const
inline

Definition at line 116 of file Types.h.

References llvm::abi::Complex, and Kind.

◆ isEmptyRecord()

bool llvm::abi::Type::isEmptyRecord ( ) const

True if this type is a record that is empty for ABI purposes.

Definition at line 64 of file Types.cpp.

References llvm::dyn_cast().

Referenced by llvm::abi::TargetInfo::isHomogeneousAggregate().

◆ isFloat()

bool llvm::abi::Type::isFloat ( ) const
inline

Definition at line 109 of file Types.h.

References llvm::abi::Float, and Kind.

◆ isInteger()

bool llvm::abi::Type::isInteger ( ) const
inline

Definition at line 108 of file Types.h.

References llvm::abi::Integer, and Kind.

◆ isMemberPointer()

bool llvm::abi::Type::isMemberPointer ( ) const
inline

Definition at line 115 of file Types.h.

References Kind, and llvm::abi::MemberPointer.

◆ isPointer()

bool llvm::abi::Type::isPointer ( ) const
inline

Definition at line 110 of file Types.h.

References Kind, and llvm::abi::Pointer.

◆ isRecord()

bool llvm::abi::Type::isRecord ( ) const
inline

Definition at line 114 of file Types.h.

References Kind, and llvm::abi::Record.

◆ isSVESizelessType()

bool llvm::abi::Type::isSVESizelessType ( ) const

◆ isTuple()

bool llvm::abi::Type::isTuple ( ) const
inline

Definition at line 113 of file Types.h.

References Kind, and llvm::abi::Tuple.

◆ isVector()

bool llvm::abi::Type::isVector ( ) const
inline

Definition at line 112 of file Types.h.

References Kind, and llvm::abi::Vector.

◆ isVoid()

bool llvm::abi::Type::isVoid ( ) const
inline

Definition at line 106 of file Types.h.

References Kind, and llvm::abi::Void.

Referenced by llvm::abi::DefaultTargetInfo::classifyReturnType().

◆ isZeroSize()

bool llvm::abi::Type::isZeroSize ( ) const
inline

Member Data Documentation

◆ ABIAlignment

Align llvm::abi::Type::ABIAlignment
protected

Definition at line 64 of file Types.h.

Referenced by getAlignment(), and Type().

◆ Kind

TypeKind llvm::abi::Type::Kind
protected

◆ SizeInBits

◆ UnadjustedAlignment

Align llvm::abi::Type::UnadjustedAlignment
protected

Definition at line 65 of file Types.h.

Referenced by getUnadjustedAlignment(), and Type().


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