LLVM 24.0.0git
llvm::abi Namespace Reference

Classes

class  AArch64TargetInfo
struct  ABICompatInfo
 Flags controlling target-specific ABI compatibility behaviour. More...
struct  ArgEntry
class  ArgInfo
 Helper class to encapsulate information about how a specific type should be passed to or returned from a function. More...
class  ArrayType
class  AtomicType
class  BPFTargetInfo
class  ComplexType
struct  FieldInfo
class  FloatType
class  FunctionInfo
class  IntegerType
class  IRTypeMapper
class  MemberPointerType
class  PointerLikeType
class  PointerType
class  RecordType
class  RequiredArgs
 Whether a signature accepts arguments beyond its declared parameters, and where the declared ones end when it does. More...
class  TargetInfo
class  TupleType
 A homogeneous tuple of 2, 3, or 4 identical vectors, such as the AArch64 SVE types svint32x3_t and svboolx2_t. More...
class  Type
 Represents the ABI-specific view of a type in LLVM. More...
class  TypeBuilder
 TypeBuilder manages the lifecycle of ABI types using bump pointer allocation. More...
class  VectorType
class  VoidType
class  X86_64TargetInfo

Enumerations

enum  RecordArgABI { RAA_Default = 0 , RAA_DirectInMemory , RAA_Indirect }
enum class  X86AVXABILevel { None , AVX , AVX512 , Last = AVX512 }
 The AVX ABI level for X86 targets. More...
enum class  AArch64ABIKind { AAPCS = 0 , DarwinPCS , Win64 , AAPCSSoft }
enum class  TypeKind {
  Void , Atomic , MemberPointer , Complex ,
  Integer , Float , Pointer , Array ,
  Vector , Tuple , Record
}
enum class  VectorKind { Generic , SVEData , SVEPredicate , SVECount }
 Distinguishes the vector flavors that ABIs have to treat differently. More...
enum class  StructPacking { Default , Packed , ExplicitPacking }
enum  RecordFlags : unsigned {
  None = 0 , CanPassInRegisters = 1 << 0 , IsUnion = 1 << 1 , IsTransparent = 1 << 2 ,
  IsCXXRecord = 1 << 3 , IsPolymorphic = 1 << 4 , HasFlexibleArrayMember = 1 << 5 , LLVM_MARK_AS_BITMASK_ENUM =( HasFlexibleArrayMember)
}

Functions

LLVM_ABI std::unique_ptr< TargetInfocreateBPFTargetInfo (TypeBuilder &TB)
LLVM_ABI std::unique_ptr< TargetInfocreateX86_64TargetInfo (TypeBuilder &TB, X86AVXABILevel AVXLevel, bool Has64BitPointers, const ABICompatInfo &Compat)
LLVM_ABI std::unique_ptr< TargetInfocreateAArch64TargetInfo (TypeBuilder &TB, AArch64ABIKind Kind)
static void reportNYI (StringRef Feature)
static unsigned getNativeVectorSizeForAVXABI (X86AVXABILevel AVXLevel)
static uint64_t getClangIntegerWidthInBits (const IntegerType *IT)
static uint64_t getClangVectorWidthInBits (const VectorType *VT)
static uint64_t getClangTypeWidthInBits (const Type *Ty)
static bool bitsContainNoUserData (const Type *Ty, unsigned StartBit, unsigned EndBit)
static const TypereduceUnionForX8664 (const RecordType *UnionType, TypeBuilder &TB)
static bool isFloatTypeWithSemantics (const Type *Ty, const fltSemantics &Semantics)
 Helper to check if a floating point type matches specific semantics.

Enumeration Type Documentation

◆ AArch64ABIKind

enum class llvm::abi::AArch64ABIKind
strong
Enumerator
AAPCS 
DarwinPCS 
Win64 
AAPCSSoft 

Definition at line 109 of file TargetInfo.h.

◆ RecordArgABI

Enumerator
RAA_Default 

Pass it using the normal C aggregate rules for the ABI, potentially introducing extra copies and passing some or all of it in registers.

RAA_DirectInMemory 

Pass it on the stack using its defined layout.

The argument must be evaluated directly into the correct stack position in the arguments area, and the call machinery must not move it or introduce extra copies.

RAA_Indirect 

Pass it as a pointer to temporary memory.

Definition at line 26 of file TargetInfo.h.

◆ RecordFlags

Enumerator
None 
CanPassInRegisters 
IsUnion 
IsTransparent 
IsCXXRecord 
IsPolymorphic 
HasFlexibleArrayMember 
LLVM_MARK_AS_BITMASK_ENUM 

Definition at line 341 of file Types.h.

◆ StructPacking

enum class llvm::abi::StructPacking
strong
Enumerator
Default 
Packed 
ExplicitPacking 

Definition at line 339 of file Types.h.

◆ TypeKind

enum class llvm::abi::TypeKind
strong
Enumerator
Void 
Atomic 
MemberPointer 
Complex 
Integer 
Float 
Pointer 
Array 
Vector 
Tuple 
Record 

Definition at line 28 of file Types.h.

◆ VectorKind

enum class llvm::abi::VectorKind
strong

Distinguishes the vector flavors that ABIs have to treat differently.

Scalability is not part of the kind. It is tracked by the vector's ElementCount, because some flavors have both a scalable and a fixed-length spelling.

Enumerator
Generic 

A plain vector, such as a Neon vector or a GCC vector_size vector.

SVEData 

An AArch64 SVE data vector, such as svint32_t.

Data vectors are passed in Z registers. Tuples of these vectors use TupleType.

SVEPredicate 

An AArch64 SVE predicate vector, such as svbool_t.

These are passed in P registers. Sizeless predicates have one-bit elements; the fixed-length arm_sve_vector_bits form keeps unsigned char (i8) elements, matching the Clang AST. Both use this kind. Tuples of these vectors use TupleType.

SVECount 

The AArch64 __SVCount_t type.

It is opaque rather than a real vector, but it occupies a predicate register, so it is given the same shape as svbool_t.

Definition at line 236 of file Types.h.

◆ X86AVXABILevel

enum class llvm::abi::X86AVXABILevel
strong

The AVX ABI level for X86 targets.

Enumerator
None 
AVX 
AVX512 
Last 

Definition at line 98 of file TargetInfo.h.

Function Documentation

◆ bitsContainNoUserData()

◆ createAArch64TargetInfo()

std::unique_ptr< TargetInfo > llvm::abi::createAArch64TargetInfo ( TypeBuilder & TB,
AArch64ABIKind Kind )

Definition at line 52 of file AArch64.cpp.

◆ createBPFTargetInfo()

std::unique_ptr< TargetInfo > llvm::abi::createBPFTargetInfo ( TypeBuilder & TB)

Definition at line 84 of file BPF.cpp.

◆ createX86_64TargetInfo()

std::unique_ptr< TargetInfo > llvm::abi::createX86_64TargetInfo ( TypeBuilder & TB,
X86AVXABILevel AVXLevel,
bool Has64BitPointers,
const ABICompatInfo & Compat )

Definition at line 1454 of file X86.cpp.

◆ getClangIntegerWidthInBits()

uint64_t llvm::abi::getClangIntegerWidthInBits ( const IntegerType * IT)
static

Definition at line 40 of file X86.cpp.

References llvm::alignTo(), llvm::bit_ceil(), IT, and uint64_t.

Referenced by getClangTypeWidthInBits(), and getClangVectorWidthInBits().

◆ getClangTypeWidthInBits()

uint64_t llvm::abi::getClangTypeWidthInBits ( const Type * Ty)
static

◆ getClangVectorWidthInBits()

◆ getNativeVectorSizeForAVXABI()

unsigned llvm::abi::getNativeVectorSizeForAVXABI ( X86AVXABILevel AVXLevel)
static

Definition at line 24 of file X86.cpp.

References AVX, AVX512, llvm_unreachable, and None.

◆ isFloatTypeWithSemantics()

bool llvm::abi::isFloatTypeWithSemantics ( const Type * Ty,
const fltSemantics & Semantics )
static

Helper to check if a floating point type matches specific semantics.

Definition at line 1134 of file X86.cpp.

References llvm::cast(), and llvm::abi::FloatType::getSemantics().

◆ reduceUnionForX8664()

◆ reportNYI()

void llvm::abi::reportNYI ( StringRef Feature)
static

Definition at line 57 of file AArch64.cpp.

References llvm::WithColor::warning().