LLVM 24.0.0git
llvm::abi::TargetInfo Class Referenceabstract

#include "llvm/ABI/TargetInfo.h"

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

Public Member Functions

 TargetInfo (TypeBuilder &Builder)
virtual ~TargetInfo ()=default
virtual void computeInfo (FunctionInfo &FI) const =0
 Populate FI with the target's ABI-lowering decisions for each argument and return value.
virtual bool isPassByRef (const Type *Ty) const
virtual const ABICompatInfogetABICompatInfo () const =0
 Return this target's ABI compatibility flags.

Protected Member Functions

LLVM_ABI RecordArgABI getRecordArgABI (const RecordType *RT) const
LLVM_ABI RecordArgABI getRecordArgABI (const Type *Ty) const
LLVM_ABI bool isPromotableInteger (const IntegerType *IT) const
LLVM_ABI ArgInfo getNaturalAlignIndirect (const Type *Ty, bool ByVal=true) const
LLVM_ABI bool isAggregateTypeForABI (const Type *Ty) const
LLVM_ABI const TypeuseFirstFieldIfTransparentUnion (const Type *Ty) const
 If Ty is a transparent union, return its first field type; otherwise return Ty unchanged.
LLVM_ABI bool maybeCommonClassifyReturnType (FunctionInfo &FI) const
 Apply rules for classifying return types that are common to all targets.
virtual bool isHomogeneousAggregateBaseType (const Type *Ty) const
 Return true if Ty is a valid base type for a homogeneous aggregate.
virtual bool isHomogeneousAggregateSmallEnough (const Type *Base, uint64_t Members) const
 Return true if a homogeneous aggregate with Members copies of Base is small enough to be passed in registers for this ABI.
virtual bool isZeroLengthBitfieldPermittedInHomogeneousAggregate () const
 Return true if zero-length bitfields should be ignored when deciding whether an aggregate is homogeneous.
virtual bool isPermittedToBeHomogeneousAggregate (const RecordType *RT) const
 Return true if the C++ ABI permits RT to be a homogeneous aggregate.
LLVM_ABI bool isHomogeneousAggregate (const Type *Ty, const Type *&Base, uint64_t &Members) const
 Return true if Ty is an ELFv2-style homogeneous aggregate.

Protected Attributes

TypeBuilderTB

Detailed Description

Definition at line 65 of file TargetInfo.h.

Constructor & Destructor Documentation

◆ TargetInfo()

llvm::abi::TargetInfo::TargetInfo ( TypeBuilder & Builder)
inlineexplicit

◆ ~TargetInfo()

virtual llvm::abi::TargetInfo::~TargetInfo ( )
virtualdefault

Member Function Documentation

◆ computeInfo()

virtual void llvm::abi::TargetInfo::computeInfo ( FunctionInfo & FI) const
pure virtual

Populate FI with the target's ABI-lowering decisions for each argument and return value.

Implemented in llvm::abi::AArch64TargetInfo, and llvm::abi::BPFTargetInfo.

◆ getABICompatInfo()

virtual const ABICompatInfo & llvm::abi::TargetInfo::getABICompatInfo ( ) const
pure virtual

Return this target's ABI compatibility flags.

Targets with extra flags store a derived object and return that as an ABICompatInfo reference.

Implemented in llvm::abi::AArch64TargetInfo, llvm::abi::BPFTargetInfo, and llvm::abi::X86_64TargetInfo.

References IT, and LLVM_ABI.

Referenced by isHomogeneousAggregate().

◆ getNaturalAlignIndirect()

ArgInfo TargetInfo::getNaturalAlignIndirect ( const Type * Ty,
bool ByVal = true ) const
protected

Definition at line 44 of file TargetInfo.cpp.

References llvm::abi::ArgInfo::getIndirect().

◆ getRecordArgABI() [1/2]

RecordArgABI TargetInfo::getRecordArgABI ( const RecordType * RT) const
protected

◆ getRecordArgABI() [2/2]

RecordArgABI TargetInfo::getRecordArgABI ( const Type * Ty) const
protected

Definition at line 54 of file TargetInfo.cpp.

References llvm::dyn_cast(), getRecordArgABI(), and llvm::abi::RAA_Default.

◆ isAggregateTypeForABI()

bool TargetInfo::isAggregateTypeForABI ( const Type * Ty) const
protected

Definition at line 17 of file TargetInfo.cpp.

References llvm::dyn_cast(), and isAggregateTypeForABI().

Referenced by isAggregateTypeForABI().

◆ isHomogeneousAggregate()

bool TargetInfo::isHomogeneousAggregate ( const Type * Ty,
const Type *& Base,
uint64_t & Members ) const
protected

◆ isHomogeneousAggregateBaseType()

virtual bool llvm::abi::TargetInfo::isHomogeneousAggregateBaseType ( const Type * Ty) const
inlineprotectedvirtual

Return true if Ty is a valid base type for a homogeneous aggregate.

Definition at line 99 of file TargetInfo.h.

Referenced by isHomogeneousAggregate().

◆ isHomogeneousAggregateSmallEnough()

virtual bool llvm::abi::TargetInfo::isHomogeneousAggregateSmallEnough ( const Type * Base,
uint64_t Members ) const
inlineprotectedvirtual

Return true if a homogeneous aggregate with Members copies of Base is small enough to be passed in registers for this ABI.

Definition at line 105 of file TargetInfo.h.

References llvm::sampleprof::Base, and uint64_t.

Referenced by isHomogeneousAggregate().

◆ isPassByRef()

virtual bool llvm::abi::TargetInfo::isPassByRef ( const Type * Ty) const
inlinevirtual

Definition at line 77 of file TargetInfo.h.

◆ isPermittedToBeHomogeneousAggregate()

virtual bool llvm::abi::TargetInfo::isPermittedToBeHomogeneousAggregate ( const RecordType * RT) const
inlineprotectedvirtual

Return true if the C++ ABI permits RT to be a homogeneous aggregate.

Definition at line 117 of file TargetInfo.h.

Referenced by isHomogeneousAggregate().

◆ isPromotableInteger()

bool TargetInfo::isPromotableInteger ( const IntegerType * IT) const
protected

Definition at line 37 of file TargetInfo.cpp.

References llvm::BitWidth, and IT.

◆ isZeroLengthBitfieldPermittedInHomogeneousAggregate()

virtual bool llvm::abi::TargetInfo::isZeroLengthBitfieldPermittedInHomogeneousAggregate ( ) const
inlineprotectedvirtual

Return true if zero-length bitfields should be ignored when deciding whether an aggregate is homogeneous.

Definition at line 112 of file TargetInfo.h.

Referenced by isHomogeneousAggregate().

◆ maybeCommonClassifyReturnType()

bool TargetInfo::maybeCommonClassifyReturnType ( FunctionInfo & FI) const
protected

Apply rules for classifying return types that are common to all targets.

Definition at line 74 of file TargetInfo.cpp.

References llvm::dyn_cast(), llvm::abi::ArgInfo::getIndirect(), llvm::abi::FunctionInfo::getReturnInfo(), and llvm::abi::FunctionInfo::getReturnType().

Referenced by llvm::abi::AArch64TargetInfo::computeInfo().

◆ useFirstFieldIfTransparentUnion()

const Type * TargetInfo::useFirstFieldIfTransparentUnion ( const Type * Ty) const
protected

If Ty is a transparent union, return its first field type; otherwise return Ty unchanged.

Definition at line 63 of file TargetInfo.cpp.

References assert(), and llvm::dyn_cast().

Member Data Documentation

◆ TB

TypeBuilder& llvm::abi::TargetInfo::TB
protected

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