|
LLVM 24.0.0git
|
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 , IndirectAliased , Ignore } |
Public Member Functions | |
| ArgInfo & | setSignExt (bool SignExtend=true) |
| ArgInfo & | setZeroExt (bool ZeroExtend=true) |
| ArgInfo & | setCanBeFlattened (bool Flatten) |
| See getCanBeFlattened. | |
| Kind | getKind () const |
| bool | isDirect () const |
| bool | isIndirect () const |
| bool | isIndirectAliased () const |
| bool | isIgnore () const |
| bool | isExtend () const |
| unsigned | getDirectOffset () const |
| unsigned | getNeededIntRegs () const |
| How many integer and vector argument registers this argument occupies. | |
| unsigned | getNeededSseRegs () const |
| void | setNeededRegs (unsigned IntRegs, unsigned SseRegs) |
| MaybeAlign | getDirectAlign () const |
| Align | getIndirectAlign () const |
| unsigned | getIndirectAddrSpace () const |
| bool | getIndirectByVal () const |
| bool | getIndirectRealign () const |
| bool | getCanBeFlattened () const |
| Whether a Direct record coercion may be split into one wire argument per field. | |
| bool | isSignExt () const |
| bool | isZeroExt () const |
| bool | isNoExt () const |
| const Type * | getCoerceToType () const |
Static Public Member Functions | |
| static ArgInfo | getDirect (const Type *T=nullptr, unsigned Offset=0, MaybeAlign Align=std::nullopt, bool CanBeFlattened=true) |
| 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 | getIndirectAliased (Align Align, unsigned AddrSpace, bool Realign=false) |
| An aliased indirect argument. | |
| static ArgInfo | getIgnore () |
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.
| 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. |
| IndirectAliased | Like Indirect, but the pointer may alias an object referenced elsewhere. The callee must not modify it and never treats it as byval. |
| Ignore | Ignore the argument (treat as void). Useful for void and empty structs. |
Definition at line 32 of file FunctionInfo.h.
|
inline |
Whether a Direct record coercion may be split into one wire argument per field.
Mirrors clang::CodeGen::ABIArgInfo::CanBeFlattened.
Definition at line 226 of file FunctionInfo.h.
References assert(), and isDirect().
Definition at line 246 of file FunctionInfo.h.
References assert(), isDirect(), and isExtend().
|
inlinestatic |
| T | The type to coerce to. If null, the argument's original type is used directly. |
| Offset | Byte 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). |
| Align | Override for the argument's alignment. If absent, the default alignment for T is used. |
| CanBeFlattened | Whether a record coercion may be split into one wire argument per field. See getCanBeFlattened. |
Definition at line 97 of file FunctionInfo.h.
References Direct, DirectAttr, llvm::Offset, and T.
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), and llvm::abi::DefaultTargetInfo::classifyReturnType().
|
inline |
Definition at line 196 of file FunctionInfo.h.
References assert(), isDirect(), and isExtend().
|
inline |
Definition at line 179 of file FunctionInfo.h.
References assert(), DirectAttr, isDirect(), and isExtend().
Definition at line 108 of file FunctionInfo.h.
References assert(), llvm::cast(), DirectAttr, Extend, setSignExt(), setZeroExt(), and T.
Referenced by llvm::abi::DefaultTargetInfo::classifyArgumentType(), and llvm::abi::DefaultTargetInfo::classifyReturnType().
|
inlinestatic |
Definition at line 149 of file FunctionInfo.h.
References Ignore.
Referenced by llvm::abi::DefaultTargetInfo::classifyReturnType().
|
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 128 of file FunctionInfo.h.
References Indirect, and IndirectAttr.
Referenced by llvm::abi::TargetInfo::getNaturalAlignIndirect(), and llvm::abi::TargetInfo::maybeCommonClassifyReturnType().
|
inline |
Definition at line 208 of file FunctionInfo.h.
References assert(), IndirectAttr, isIndirect(), and isIndirectAliased().
|
inlinestatic |
An aliased indirect argument.
It carries an address space but no byval, since the pointer refers to an object the caller owns.
Definition at line 140 of file FunctionInfo.h.
References IndirectAliased, and IndirectAttr.
|
inline |
Definition at line 201 of file FunctionInfo.h.
References assert(), isIndirect(), and isIndirectAliased().
|
inline |
Definition at line 213 of file FunctionInfo.h.
References assert(), and isIndirect().
|
inline |
Definition at line 219 of file FunctionInfo.h.
References assert(), isIndirect(), and isIndirectAliased().
|
inline |
Definition at line 172 of file FunctionInfo.h.
|
inline |
How many integer and vector argument registers this argument occupies.
Both zero means it occupies none and travels in memory, which is also what a target whose classifier does not record the demand reports.
Definition at line 187 of file FunctionInfo.h.
|
inline |
Definition at line 188 of file FunctionInfo.h.
|
inline |
Definition at line 173 of file FunctionInfo.h.
References Direct.
Referenced by getCanBeFlattened(), getCoerceToType(), getDirectAlign(), getDirectOffset(), and setCanBeFlattened().
|
inline |
Definition at line 177 of file FunctionInfo.h.
References Extend.
Referenced by getCoerceToType(), getDirectAlign(), getDirectOffset(), isNoExt(), isSignExt(), and isZeroExt().
|
inline |
Definition at line 176 of file FunctionInfo.h.
References Ignore.
|
inline |
Definition at line 174 of file FunctionInfo.h.
References Indirect.
Referenced by getIndirectAddrSpace(), getIndirectAlign(), getIndirectByVal(), and getIndirectRealign().
|
inline |
Definition at line 175 of file FunctionInfo.h.
References IndirectAliased.
Referenced by getIndirectAddrSpace(), getIndirectAlign(), and getIndirectRealign().
|
inline |
Definition at line 241 of file FunctionInfo.h.
References assert(), and isExtend().
|
inline |
Definition at line 231 of file FunctionInfo.h.
References assert(), and isExtend().
|
inline |
Definition at line 236 of file FunctionInfo.h.
References assert(), and isExtend().
See getCanBeFlattened.
Definition at line 166 of file FunctionInfo.h.
References assert(), and isDirect().
Definition at line 190 of file FunctionInfo.h.
Definition at line 151 of file FunctionInfo.h.
Referenced by getExtend().
Definition at line 158 of file FunctionInfo.h.
Referenced by getExtend().
| DirectAttrInfo llvm::abi::ArgInfo::DirectAttr |
Definition at line 68 of file FunctionInfo.h.
Referenced by getDirect(), getDirectOffset(), and getExtend().
| IndirectAttrInfo llvm::abi::ArgInfo::IndirectAttr |
Definition at line 69 of file FunctionInfo.h.
Referenced by getIndirect(), getIndirectAddrSpace(), and getIndirectAliased().