|
clang 24.0.0git
|
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to or returned from a function. More...
#include "clang/CodeGen/CGFunctionInfo.h"
Public Types | |
| enum | Kind : uint8_t { Direct , Extend , Indirect , IndirectAliased , Ignore , Expand , CoerceAndExpand , TargetSpecific , InAlloca , KindFirst = Direct , KindLast = InAlloca } |
Static Public Member Functions | |
| static ABIArgInfo | getDirect (llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true, unsigned Align=0) |
| static ABIArgInfo | getDirectInReg (llvm::Type *T=nullptr) |
| static ABIArgInfo | getSignExtend (QualType Ty, llvm::Type *T=nullptr, llvm::Type *Padding=nullptr) |
| static ABIArgInfo | getZeroExtend (QualType Ty, llvm::Type *T=nullptr, llvm::Type *Padding=nullptr) |
| static ABIArgInfo | getExtend (QualType Ty, llvm::Type *T=nullptr, llvm::Type *Padding=nullptr) |
| static ABIArgInfo | getNoExtend (llvm::IntegerType *T) |
| static ABIArgInfo | getExtendInReg (QualType Ty, llvm::Type *T=nullptr) |
| static ABIArgInfo | getIgnore () |
| static ABIArgInfo | getIndirect (CharUnits Alignment, unsigned AddrSpace, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr) |
| static ABIArgInfo | getIndirectAliased (CharUnits Alignment, unsigned AddrSpace, bool Realign=false, llvm::Type *Padding=nullptr) |
| Pass this in memory using the IR byref attribute. | |
| static ABIArgInfo | getIndirectInReg (CharUnits Alignment, bool ByVal=true, bool Realign=false) |
| static ABIArgInfo | getInAlloca (unsigned FieldIndex, bool Indirect=false) |
| static ABIArgInfo | getExpand () |
| static ABIArgInfo | getExpandWithPadding (bool PaddingInReg, llvm::Type *Padding) |
| static ABIArgInfo | getCoerceAndExpand (llvm::StructType *coerceToType, llvm::Type *unpaddedCoerceToType) |
| static ABIArgInfo | getTargetSpecific (llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true, unsigned Align=0) |
| static bool | isPaddingForCoerceAndExpand (llvm::Type *eltType) |
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to or returned from a function.
Definition at line 31 of file CGFunctionInfo.h.
| Enumerator | |
|---|---|
| Direct | Direct - Pass the argument directly using the normal converted LLVM type, or by coercing to another specified type stored in 'CoerceToType'). If an offset is specified (in UIntData), then the argument passed is offset by some number of bytes in the memory representation. A dummy argument is emitted before the real argument if the specified type stored in "PaddingType" is not zero. |
| Extend | Extend - Valid only for integer argument types. Same as 'direct' but also emit a zero/sign extension attribute. |
| Indirect | Indirect - Pass the argument indirectly via a hidden pointer with the specified alignment (0 indicates default alignment) and address space. |
| IndirectAliased | IndirectAliased - Similar to Indirect, but the pointer may be to an object that is otherwise referenced. The object is known to not be modified through any other references for the duration of the call, and the callee must not itself modify the object. Because C allows parameter variables to be modified and guarantees that they have unique addresses, the callee must defensively copy the object into a local variable if it might be modified or its address might be compared. Since those are uncommon, in principle this convention allows programs to avoid copies in more situations. However, it may introduce extra copies if the callee fails to prove that a copy is unnecessary and the caller naturally produces an unaliased object for the argument. |
| Ignore | Ignore - Ignore the argument (treat as void). Useful for void and empty structs. |
| Expand | Expand - Only valid for aggregate argument types. The structure should be expanded into consecutive arguments for its constituent fields. Currently expand is only allowed on structures whose fields are all scalar types or are themselves expandable types. |
| CoerceAndExpand | CoerceAndExpand - Only valid for aggregate argument types. The structure should be expanded into consecutive arguments corresponding to the non-array elements of the type stored in CoerceToType. Array elements in the type are assumed to be padding and skipped. |
| TargetSpecific | TargetSpecific - Some argument types are passed as target specific types such as RISC-V's tuple type, these need to be handled in the target hook. |
| InAlloca | InAlloca - Pass the argument directly using the LLVM inalloca attribute. This is similar to indirect with byval, except it only applies to arguments stored in memory and forbids any implicit copies. When applied to a return type, it means the value is returned indirectly via an implicit sret parameter stored in the argument struct. |
| KindFirst | |
| KindLast | |
Definition at line 33 of file CGFunctionInfo.h.
Definition at line 140 of file CGFunctionInfo.h.
References Direct, DirectAttr, false, clang::nullptr, and PaddingType.
Referenced by getCoerceAndExpand(), getDirect(), getDirectInReg(), getExpand(), getExpandWithPadding(), getExtend(), getExtendInReg(), getIgnore(), getInAlloca(), getIndirect(), getIndirectAliased(), getIndirectInReg(), getNoExtend(), getSignExtend(), getTargetSpecific(), and getZeroExtend().
|
inline |
Definition at line 331 of file CGFunctionInfo.h.
References isCoerceAndExpand(), isDirect(), isExtend(), and isTargetSpecific().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), DetermineNoUndef(), getCoerceToType(), and setCoerceToType().
| LLVM_DUMP_METHOD void ABIArgInfo::dump | ( | ) | const |
Definition at line 29 of file TargetInfo.cpp.
References CoerceAndExpand, Direct, Expand, Extend, getCoerceAndExpandType(), getCoerceToType(), getInAllocaFieldIndex(), getIndirectAddrSpace(), getIndirectAlign(), getIndirectByVal(), getIndirectRealign(), clang::CharUnits::getQuantity(), Ignore, InAlloca, Indirect, IndirectAliased, and TargetSpecific.
|
inline |
Definition at line 512 of file CGFunctionInfo.h.
References isDirect(), and isTargetSpecific().
Referenced by canApplyNoFPClass(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and clang::CodeGen::CodeGenTypes::GetFunctionType().
|
inlinestatic |
| unpaddedCoerceToType | The coerce-to type with padding elements removed, canonicalized to a single element if it would otherwise have exactly one element. |
Definition at line 269 of file CGFunctionInfo.h.
References ABIArgInfo(), CoerceAndExpand, and isPaddingForCoerceAndExpand().
Referenced by classifyExpandedType().
|
inline |
Definition at line 403 of file CGFunctionInfo.h.
References clang::cast(), and isCoerceAndExpand().
Referenced by dump(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), and clang::CodeGen::CodeGenFunction::EmitFunctionProlog().
|
inline |
Definition at line 413 of file CGFunctionInfo.h.
References isCoerceAndExpand(), and UnpaddedCoerceAndExpandType.
Referenced by clang::CodeGen::CodeGenTypes::GetFunctionType().
|
inline |
Definition at line 393 of file CGFunctionInfo.h.
References canHaveCoerceToType().
Referenced by canApplyNoFPClass(), clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), DetermineNoUndef(), dump(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::EmitVAArgInstr(), and clang::CodeGen::CodeGenTypes::GetFunctionType().
|
inlinestatic |
Definition at line 147 of file CGFunctionInfo.h.
References ABIArgInfo(), Direct, and clang::T.
Referenced by clang::CodeGen::DefaultABIInfo::classifyArgumentType(), clang::CodeGen::DefaultABIInfo::classifyReturnType(), classifyType(), and getDirectInReg().
|
inline |
Definition at line 348 of file CGFunctionInfo.h.
References DirectAttr, isDirect(), isExtend(), and isTargetSpecific().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), and clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
inlinestatic |
Definition at line 158 of file CGFunctionInfo.h.
References ABIArgInfo(), getDirect(), and clang::T.
|
inline |
Definition at line 337 of file CGFunctionInfo.h.
References DirectAttr, isDirect(), isExtend(), and isTargetSpecific().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and clang::CodeGen::EmitVAArgInstr().
|
inlinestatic |
Definition at line 253 of file CGFunctionInfo.h.
References ABIArgInfo(), and Expand.
Referenced by classifyType(), and getExpandWithPadding().
|
inlinestatic |
Definition at line 258 of file CGFunctionInfo.h.
References ABIArgInfo(), and getExpand().
|
inlinestatic |
Definition at line 190 of file CGFunctionInfo.h.
References ABIArgInfo(), getSignExtend(), getZeroExtend(), clang::Type::hasSignedIntegerRepresentation(), clang::Type::isIntegralOrEnumerationType(), and clang::T.
Referenced by clang::CodeGen::DefaultABIInfo::classifyArgumentType(), clang::CodeGen::DefaultABIInfo::classifyReturnType(), and getExtendInReg().
|
inlinestatic |
Definition at line 208 of file CGFunctionInfo.h.
References ABIArgInfo(), getExtend(), and clang::T.
|
inlinestatic |
Definition at line 213 of file CGFunctionInfo.h.
References ABIArgInfo(), and Ignore.
Referenced by classifyExpandedType(), clang::CodeGen::DefaultABIInfo::classifyReturnType(), and classifyType().
|
inlinestatic |
Definition at line 247 of file CGFunctionInfo.h.
References ABIArgInfo(), InAlloca, and Indirect.
|
inline |
Definition at line 482 of file CGFunctionInfo.h.
References AllocaFieldIndex, and isInAlloca().
Referenced by dump(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), and clang::CodeGen::CodeGenFunction::EmitFunctionProlog().
|
inline |
Definition at line 491 of file CGFunctionInfo.h.
References isInAlloca().
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), and clang::CodeGen::CodeGenFunction::EmitFunctionProlog().
|
inline |
Return true if this field of an inalloca struct should be returned to implement a struct return calling convention.
Definition at line 502 of file CGFunctionInfo.h.
References isInAlloca().
Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), and clang::CodeGen::CodeGenTypes::GetFunctionType().
|
inlinestatic |
Definition at line 216 of file CGFunctionInfo.h.
References ABIArgInfo(), and Indirect.
Referenced by classifyExpandedType(), classifyType(), getIndirectInReg(), and clang::CodeGen::ABIInfo::getNaturalAlignIndirect().
|
inline |
Definition at line 454 of file CGFunctionInfo.h.
References IndirectAttr, isIndirect(), and isIndirectAliased().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), dump(), clang::CodeGen::CodeGenFunction::EmitCall(), and clang::CodeGen::CodeGenTypes::GetFunctionType().
|
inlinestatic |
Pass this in memory using the IR byref attribute.
Definition at line 230 of file CGFunctionInfo.h.
References ABIArgInfo(), and IndirectAliased.
|
inline |
Definition at line 436 of file CGFunctionInfo.h.
References clang::CharUnits::fromQuantity(), IndirectAttr, isIndirect(), and isIndirectAliased().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), dump(), clang::CodeGen::CodeGenFunction::EmitCall(), and clang::CodeGen::CodeGenFunction::EmitFunctionProlog().
|
inline |
Definition at line 445 of file CGFunctionInfo.h.
References isIndirect().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), dump(), clang::CodeGen::CodeGenFunction::EmitCall(), and clang::CodeGen::CodeGenFunction::EmitParmDecl().
|
inlinestatic |
Definition at line 241 of file CGFunctionInfo.h.
References ABIArgInfo(), and getIndirect().
Referenced by clang::CodeGen::ABIInfo::getNaturalAlignIndirectInReg().
|
inline |
Definition at line 464 of file CGFunctionInfo.h.
References isIndirect(), and isIndirectAliased().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), dump(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and clang::CodeGen::EmitVAArgInstr().
|
inline |
Definition at line 423 of file CGFunctionInfo.h.
References isDirect(), isExtend(), isIndirect(), and isTargetSpecific().
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::EmitVAArgInstr(), isArgInAlloca(), and clang::CodeGen::CodeGenModule::ReturnTypeHasInReg().
|
inline |
Definition at line 320 of file CGFunctionInfo.h.
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), DetermineNoUndef(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenTypes::GetFunctionType(), isArgInAlloca(), and similar().
|
inlinestatic |
Definition at line 199 of file CGFunctionInfo.h.
References ABIArgInfo(), Extend, and clang::T.
|
inline |
Definition at line 386 of file CGFunctionInfo.h.
Referenced by clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
inline |
Definition at line 382 of file CGFunctionInfo.h.
References PaddingType.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::EmitVAArgInstr(), and clang::CodeGen::CodeGenTypes::GetFunctionType().
|
inlinestatic |
Definition at line 164 of file CGFunctionInfo.h.
References ABIArgInfo(), Extend, clang::Type::isIntegralOrEnumerationType(), and clang::T.
Referenced by getExtend().
|
inlinestatic |
Definition at line 301 of file CGFunctionInfo.h.
References ABIArgInfo(), clang::T, and TargetSpecific.
|
inline |
Definition at line 408 of file CGFunctionInfo.h.
References isCoerceAndExpand(), and UnpaddedCoerceAndExpandType.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and clang::CodeGen::CodeGenTypes::GetFunctionType().
|
inlinestatic |
Definition at line 176 of file CGFunctionInfo.h.
References ABIArgInfo(), Extend, clang::Type::isIntegralOrEnumerationType(), and clang::T.
Referenced by getExtend().
|
inline |
Definition at line 328 of file CGFunctionInfo.h.
References CoerceAndExpand.
Referenced by canHaveCoerceToType(), clang::CodeGen::CodeGenFunction::EmitCall(), getCoerceAndExpandType(), getCoerceAndExpandTypeSequence(), and getUnpaddedCoerceAndExpandType().
|
inline |
Definition at line 321 of file CGFunctionInfo.h.
References Direct.
Referenced by canHaveCoerceToType(), clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), clang::CodeGen::CodeGenFunction::EmitMustTailThunk(), clang::CodeGen::EmitVAArgInstr(), getCanBeFlattened(), getDirectAlign(), getDirectOffset(), clang::CodeGen::CodeGenTypes::GetFunctionType(), getInReg(), setCanBeFlattened(), setDirectAlign(), setDirectOffset(), and setInReg().
|
inline |
Definition at line 327 of file CGFunctionInfo.h.
References Expand.
|
inline |
Definition at line 323 of file CGFunctionInfo.h.
References Extend.
Referenced by canHaveCoerceToType(), clang::CodeGen::EmitVAArgInstr(), getDirectAlign(), getDirectOffset(), getInReg(), isNoExt(), isSignExt(), isZeroExt(), setDirectAlign(), setDirectOffset(), setInReg(), setSignExt(), and setZeroExt().
|
inline |
Definition at line 324 of file CGFunctionInfo.h.
References Ignore.
|
inline |
Definition at line 322 of file CGFunctionInfo.h.
References InAlloca.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitMustTailThunk(), getInAllocaFieldIndex(), getInAllocaIndirect(), getInAllocaSRet(), setInAllocaFieldIndex(), setInAllocaIndirect(), and setInAllocaSRet().
|
inline |
Definition at line 325 of file CGFunctionInfo.h.
References Indirect.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitMustTailThunk(), clang::CodeGen::CodeGenFunction::EmitParmDecl(), clang::CodeGen::EmitVAArgInstr(), getIndirectAddrSpace(), getIndirectAlign(), getIndirectByVal(), getIndirectRealign(), getInReg(), isSRetAfterThis(), clang::CodeGen::CodeGenModule::ReturnTypeUsesSRet(), setIndirectAddrSpace(), setIndirectAlign(), setIndirectByVal(), setIndirectRealign(), setInReg(), and setSRetAfterThis().
|
inline |
Definition at line 326 of file CGFunctionInfo.h.
References IndirectAliased.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), getIndirectAddrSpace(), getIndirectAlign(), getIndirectRealign(), setIndirectAddrSpace(), setIndirectAlign(), and setIndirectRealign().
|
inline |
Definition at line 377 of file CGFunctionInfo.h.
References isExtend().
Referenced by DetermineNoUndef().
|
inlinestatic |
Definition at line 315 of file CGFunctionInfo.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), clang::CodeGen::CodeGenFunction::EmitFunctionProlog(), and getCoerceAndExpand().
|
inline |
Definition at line 359 of file CGFunctionInfo.h.
References isExtend().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), and clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
inline |
Definition at line 473 of file CGFunctionInfo.h.
References isIndirect().
Referenced by clang::CodeGen::CodeGenFunction::EmitFunctionEpilog(), and clang::CodeGen::CodeGenFunction::EmitMustTailThunk().
|
inline |
Definition at line 329 of file CGFunctionInfo.h.
References TargetSpecific.
Referenced by canHaveCoerceToType(), getCanBeFlattened(), getDirectAlign(), getDirectOffset(), getInReg(), setCanBeFlattened(), setDirectAlign(), setDirectOffset(), and setInReg().
|
inline |
Definition at line 368 of file CGFunctionInfo.h.
References isExtend().
Referenced by clang::CodeGen::CodeGenModule::computeABIInfoUsingLib(), and clang::CodeGen::CodeGenModule::ConstructAttributeList().
|
inline |
Definition at line 517 of file CGFunctionInfo.h.
References isDirect(), and isTargetSpecific().
|
inline |
Definition at line 398 of file CGFunctionInfo.h.
References canHaveCoerceToType(), and clang::T.
|
inline |
Definition at line 353 of file CGFunctionInfo.h.
References DirectAttr, isDirect(), isExtend(), and isTargetSpecific().
|
inline |
Definition at line 342 of file CGFunctionInfo.h.
References DirectAttr, isDirect(), isExtend(), and isTargetSpecific().
|
inline |
Definition at line 486 of file CGFunctionInfo.h.
References AllocaFieldIndex, and isInAlloca().
|
inline |
Definition at line 495 of file CGFunctionInfo.h.
References Indirect, and isInAlloca().
|
inline |
Definition at line 507 of file CGFunctionInfo.h.
References isInAlloca().
|
inline |
Definition at line 459 of file CGFunctionInfo.h.
References IndirectAttr, isIndirect(), and isIndirectAliased().
|
inline |
Definition at line 440 of file CGFunctionInfo.h.
References clang::CharUnits::getQuantity(), IndirectAttr, isIndirect(), and isIndirectAliased().
|
inline |
Definition at line 449 of file CGFunctionInfo.h.
References isIndirect().
|
inline |
Definition at line 468 of file CGFunctionInfo.h.
References isIndirect(), and isIndirectAliased().
|
inline |
Definition at line 429 of file CGFunctionInfo.h.
References isDirect(), isExtend(), isIndirect(), and isTargetSpecific().
|
inline |
Definition at line 389 of file CGFunctionInfo.h.
|
inline |
Definition at line 363 of file CGFunctionInfo.h.
References isExtend().
|
inline |
Definition at line 477 of file CGFunctionInfo.h.
References isIndirect().
|
inline |
Definition at line 372 of file CGFunctionInfo.h.
References isExtend().
| unsigned clang::CodeGen::ABIArgInfo::AllocaFieldIndex |
Definition at line 111 of file CGFunctionInfo.h.
Referenced by getInAllocaFieldIndex(), and setInAllocaFieldIndex().
| DirectAttrInfo clang::CodeGen::ABIArgInfo::DirectAttr |
Definition at line 109 of file CGFunctionInfo.h.
Referenced by ABIArgInfo(), getDirectAlign(), getDirectOffset(), setDirectAlign(), and setDirectOffset().
| IndirectAttrInfo clang::CodeGen::ABIArgInfo::IndirectAttr |
Definition at line 110 of file CGFunctionInfo.h.
Referenced by getIndirectAddrSpace(), getIndirectAlign(), setIndirectAddrSpace(), and setIndirectAlign().
| llvm::Type* clang::CodeGen::ABIArgInfo::PaddingType |
Definition at line 97 of file CGFunctionInfo.h.
Referenced by ABIArgInfo(), and getPaddingType().
| llvm::Type* clang::CodeGen::ABIArgInfo::UnpaddedCoerceAndExpandType |
Definition at line 98 of file CGFunctionInfo.h.
Referenced by getCoerceAndExpandTypeSequence(), and getUnpaddedCoerceAndExpandType().