LLVM 23.0.0git
llvm::abi::ArgInfo Class Reference

Helper class to encapsulate information about how a specific type should be passed to or returned from a function. More...

#include "llvm/ABI/FunctionInfo.h"

Public Types

enum  Kind { Direct , Extend , Indirect , Ignore }

Public Member Functions

ArgInfosetSignExt (bool SignExtend=true)
ArgInfosetZeroExt (bool ZeroExtend=true)
Kind getKind () const
bool isDirect () const
bool isIndirect () const
bool isIgnore () const
bool isExtend () const
unsigned getDirectOffset () const
MaybeAlign getDirectAlign () const
Align getIndirectAlign () const
unsigned getIndirectAddrSpace () const
bool getIndirectByVal () const
bool getIndirectRealign () const
bool isSignExt () const
bool isZeroExt () const
bool isNoExt () const
const TypegetCoerceToType () const

Static Public Member Functions

static ArgInfo getDirect (const Type *T=nullptr, unsigned Offset=0, MaybeAlign Align=std::nullopt)
static ArgInfo getExtend (const Type *T)
static ArgInfo getIndirect (Align Align, bool ByVal, unsigned AddrSpace=0, bool Realign=false)
 Realign: the caller couldn't guarantee sufficient alignment - the callee must copy the argument to a properly aligned temporary before use.
static ArgInfo getIgnore ()

Detailed Description

Helper class to encapsulate information about how a specific type should be passed to or returned from a function.

Definition at line 30 of file FunctionInfo.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Direct 

Pass the argument directly using the normal converted LLVM type, or by coercing to another specified type stored in 'CoerceToType'.

Extend 

Valid only for integer argument types.

Same as 'direct' but also emit a zero/sign extension attribute.

Indirect 

Pass the argument indirectly via a hidden pointer with the specified alignment and address space.

Ignore 

Ignore the argument (treat as void). Useful for void and empty structs.

Definition at line 32 of file FunctionInfo.h.

Member Function Documentation

◆ getCoerceToType()

const Type * llvm::abi::ArgInfo::getCoerceToType ( ) const
inline

Definition at line 189 of file FunctionInfo.h.

References assert(), isDirect(), and isExtend().

◆ getDirect()

ArgInfo llvm::abi::ArgInfo::getDirect ( const Type * T = nullptr,
unsigned Offset = 0,
MaybeAlign Align = std::nullopt )
inlinestatic
Parameters
TThe type to coerce to. If null, the argument's original type is used directly.
OffsetByte offset into the memory representation at which the coerced type begins. Used when only part of a larger value is passed directly (e.g. the high word of a multi-eightbyte return value on x86-64).
AlignOverride for the argument's alignment. If absent, the default alignment for T is used.

Definition at line 83 of file FunctionInfo.h.

References Direct, DirectAttr, llvm::Offset, and T.

◆ getDirectAlign()

MaybeAlign llvm::abi::ArgInfo::getDirectAlign ( ) const
inline

Definition at line 149 of file FunctionInfo.h.

References assert(), DirectAttr, isDirect(), and isExtend().

◆ getDirectOffset()

unsigned llvm::abi::ArgInfo::getDirectOffset ( ) const
inline

Definition at line 144 of file FunctionInfo.h.

References assert(), DirectAttr, isDirect(), and isExtend().

◆ getExtend()

ArgInfo llvm::abi::ArgInfo::getExtend ( const Type * T)
inlinestatic

Definition at line 92 of file FunctionInfo.h.

References assert(), llvm::cast(), DirectAttr, Extend, setSignExt(), setZeroExt(), and T.

◆ getIgnore()

ArgInfo llvm::abi::ArgInfo::getIgnore ( )
inlinestatic

Definition at line 122 of file FunctionInfo.h.

References Ignore.

◆ getIndirect()

ArgInfo llvm::abi::ArgInfo::getIndirect ( Align Align,
bool ByVal,
unsigned AddrSpace = 0,
bool Realign = false )
inlinestatic

Realign: the caller couldn't guarantee sufficient alignment - the callee must copy the argument to a properly aligned temporary before use.

Definition at line 112 of file FunctionInfo.h.

References Indirect, and IndirectAttr.

◆ getIndirectAddrSpace()

unsigned llvm::abi::ArgInfo::getIndirectAddrSpace ( ) const
inline

Definition at line 159 of file FunctionInfo.h.

References assert(), IndirectAttr, and isIndirect().

◆ getIndirectAlign()

Align llvm::abi::ArgInfo::getIndirectAlign ( ) const
inline

Definition at line 154 of file FunctionInfo.h.

References assert(), IndirectAttr, and isIndirect().

◆ getIndirectByVal()

bool llvm::abi::ArgInfo::getIndirectByVal ( ) const
inline

Definition at line 164 of file FunctionInfo.h.

References assert(), and isIndirect().

◆ getIndirectRealign()

bool llvm::abi::ArgInfo::getIndirectRealign ( ) const
inline

Definition at line 169 of file FunctionInfo.h.

References assert(), and isIndirect().

◆ getKind()

Kind llvm::abi::ArgInfo::getKind ( ) const
inline

Definition at line 138 of file FunctionInfo.h.

◆ isDirect()

bool llvm::abi::ArgInfo::isDirect ( ) const
inline

Definition at line 139 of file FunctionInfo.h.

References Direct.

Referenced by getCoerceToType(), getDirectAlign(), and getDirectOffset().

◆ isExtend()

bool llvm::abi::ArgInfo::isExtend ( ) const
inline

Definition at line 142 of file FunctionInfo.h.

References Extend.

Referenced by getCoerceToType(), getDirectAlign(), getDirectOffset(), isNoExt(), isSignExt(), and isZeroExt().

◆ isIgnore()

bool llvm::abi::ArgInfo::isIgnore ( ) const
inline

Definition at line 141 of file FunctionInfo.h.

References Ignore.

◆ isIndirect()

bool llvm::abi::ArgInfo::isIndirect ( ) const
inline

Definition at line 140 of file FunctionInfo.h.

References Indirect.

Referenced by getIndirectAddrSpace(), getIndirectAlign(), getIndirectByVal(), and getIndirectRealign().

◆ isNoExt()

bool llvm::abi::ArgInfo::isNoExt ( ) const
inline

Definition at line 184 of file FunctionInfo.h.

References assert(), and isExtend().

◆ isSignExt()

bool llvm::abi::ArgInfo::isSignExt ( ) const
inline

Definition at line 174 of file FunctionInfo.h.

References assert(), and isExtend().

◆ isZeroExt()

bool llvm::abi::ArgInfo::isZeroExt ( ) const
inline

Definition at line 179 of file FunctionInfo.h.

References assert(), and isExtend().

◆ setSignExt()

ArgInfo & llvm::abi::ArgInfo::setSignExt ( bool SignExtend = true)
inline

Definition at line 124 of file FunctionInfo.h.

Referenced by getExtend().

◆ setZeroExt()

ArgInfo & llvm::abi::ArgInfo::setZeroExt ( bool ZeroExtend = true)
inline

Definition at line 131 of file FunctionInfo.h.

Referenced by getExtend().

Member Data Documentation

◆ DirectAttr

DirectAttrInfo llvm::abi::ArgInfo::DirectAttr

Definition at line 60 of file FunctionInfo.h.

Referenced by getDirect(), getDirectAlign(), getDirectOffset(), and getExtend().

◆ IndirectAttr

IndirectAttrInfo llvm::abi::ArgInfo::IndirectAttr

Definition at line 61 of file FunctionInfo.h.

Referenced by getIndirect(), getIndirectAddrSpace(), and getIndirectAlign().


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