clang 20.0.0git
Classes | Functions
clang::CodeGen::swiftcall Namespace Reference

Classes

class  SwiftAggLowering
 

Functions

bool shouldPassIndirectly (CodeGenModule &CGM, ArrayRef< llvm::Type * > types, bool asReturnValue)
 Should an aggregate which expands to the given type sequence be passed/returned indirectly under swiftcall?
 
CharUnits getMaximumVoluntaryIntegerSize (CodeGenModule &CGM)
 Return the maximum voluntary integer size for the current target.
 
CharUnits getNaturalAlignment (CodeGenModule &CGM, llvm::Type *type)
 Return the Swift CC's notion of the natural alignment of a type.
 
bool isLegalIntegerType (CodeGenModule &CGM, llvm::IntegerType *type)
 Is the given integer type "legal" for Swift's perspective on the current platform?
 
bool isLegalVectorType (CodeGenModule &CGM, CharUnits vectorSize, llvm::VectorType *vectorTy)
 Is the given vector type "legal" for Swift's perspective on the current platform?
 
bool isLegalVectorType (CodeGenModule &CGM, CharUnits vectorSize, llvm::Type *eltTy, unsigned numElts)
 
std::pair< llvm::Type *, unsignedsplitLegalVectorType (CodeGenModule &CGM, CharUnits vectorSize, llvm::VectorType *vectorTy)
 Minimally split a legal vector type.
 
void legalizeVectorType (CodeGenModule &CGM, CharUnits vectorSize, llvm::VectorType *vectorTy, llvm::SmallVectorImpl< llvm::Type * > &types)
 Turn a vector type in a sequence of legal component vector types.
 
bool mustPassRecordIndirectly (CodeGenModule &CGM, const RecordDecl *record)
 Is the given record type required to be passed and returned indirectly because of language restrictions?
 
ABIArgInfo classifyReturnType (CodeGenModule &CGM, CanQualType type)
 Classify the rules for how to return a particular type.
 
ABIArgInfo classifyArgumentType (CodeGenModule &CGM, CanQualType type)
 Classify the rules for how to pass a particular type.
 
void computeABIInfo (CodeGenModule &CGM, CGFunctionInfo &FI)
 Compute the ABI information of a swiftcall function.
 
bool isSwiftErrorLoweredInRegister (CodeGenModule &CGM)
 Is swifterror lowered to a register by the target ABI?
 

Function Documentation

◆ classifyArgumentType()

ABIArgInfo clang::CodeGen::swiftcall::classifyArgumentType ( CodeGenModule CGM,
CanQualType  type 
)

Classify the rules for how to pass a particular type.

Definition at line 860 of file SwiftCallingConv.cpp.

References classifyType(), and clang::ast_matchers::type.

Referenced by computeABIInfo().

◆ classifyReturnType()

ABIArgInfo clang::CodeGen::swiftcall::classifyReturnType ( CodeGenModule CGM,
CanQualType  type 
)

Classify the rules for how to return a particular type.

Definition at line 856 of file SwiftCallingConv.cpp.

References classifyType(), and clang::ast_matchers::type.

Referenced by computeABIInfo().

◆ computeABIInfo()

void clang::CodeGen::swiftcall::computeABIInfo ( CodeGenModule CGM,
CGFunctionInfo FI 
)

◆ getMaximumVoluntaryIntegerSize()

CharUnits clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize ( CodeGenModule CGM)

◆ getNaturalAlignment()

CharUnits clang::CodeGen::swiftcall::getNaturalAlignment ( CodeGenModule CGM,
llvm::Type *  type 
)

Return the Swift CC's notion of the natural alignment of a type.

Definition at line 659 of file SwiftCallingConv.cpp.

References clang::CharUnits::fromQuantity(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CharUnits::getQuantity(), getTypeStoreSize(), and clang::ast_matchers::type.

◆ isLegalIntegerType()

bool clang::CodeGen::swiftcall::isLegalIntegerType ( CodeGenModule CGM,
llvm::IntegerType *  type 
)

Is the given integer type "legal" for Swift's perspective on the current platform?

Definition at line 668 of file SwiftCallingConv.cpp.

References clang::CodeGen::CodeGenModule::getContext(), clang::ASTContext::getTargetInfo(), and clang::TargetInfo::hasInt128Type().

Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData().

◆ isLegalVectorType() [1/2]

bool clang::CodeGen::swiftcall::isLegalVectorType ( CodeGenModule CGM,
CharUnits  vectorSize,
llvm::Type *  eltTy,
unsigned  numElts 
)

◆ isLegalVectorType() [2/2]

bool clang::CodeGen::swiftcall::isLegalVectorType ( CodeGenModule CGM,
CharUnits  vectorSize,
llvm::VectorType *  vectorTy 
)

Is the given vector type "legal" for Swift's perspective on the current platform?

Definition at line 688 of file SwiftCallingConv.cpp.

References isLegalVectorType().

Referenced by isLegalVectorType(), legalizeVectorType(), and splitLegalVectorType().

◆ isSwiftErrorLoweredInRegister()

bool clang::CodeGen::swiftcall::isSwiftErrorLoweredInRegister ( CodeGenModule CGM)

Is swifterror lowered to a register by the target ABI?

Definition at line 876 of file SwiftCallingConv.cpp.

References getSwiftABIInfo(), and clang::CodeGen::SwiftABIInfo::isSwiftErrorInRegister().

◆ legalizeVectorType()

void clang::CodeGen::swiftcall::legalizeVectorType ( CodeGenModule CGM,
CharUnits  vectorSize,
llvm::VectorType *  vectorTy,
llvm::SmallVectorImpl< llvm::Type * > &  types 
)

Turn a vector type in a sequence of legal component vector types.

The caller may assume that the sum of the data sizes of the resulting types will equal the data size of the vector type.

Definition at line 716 of file SwiftCallingConv.cpp.

References isLegalVectorType(), and isPowerOf2().

Referenced by clang::CodeGen::swiftcall::SwiftAggLowering::addTypedData().

◆ mustPassRecordIndirectly()

bool clang::CodeGen::swiftcall::mustPassRecordIndirectly ( CodeGenModule CGM,
const RecordDecl record 
)

Is the given record type required to be passed and returned indirectly because of language restrictions?

This considers only mandatory indirectness due to language restrictions, such as C++'s non-trivially-copyable types and Objective-C's __weak references. A record for which this returns true may still be passed indirectly for other reasons, such as being too large to fit in a reasonable number of registers.

Definition at line 790 of file SwiftCallingConv.cpp.

References clang::RecordDecl::canPassInRegisters().

Referenced by classifyType().

◆ shouldPassIndirectly()

bool clang::CodeGen::swiftcall::shouldPassIndirectly ( CodeGenModule CGM,
ArrayRef< llvm::Type * >  types,
bool  asReturnValue 
)

Should an aggregate which expands to the given type sequence be passed/returned indirectly under swiftcall?

Definition at line 647 of file SwiftCallingConv.cpp.

References getSwiftABIInfo(), and clang::CodeGen::SwiftABIInfo::shouldPassIndirectly().

◆ splitLegalVectorType()

std::pair< llvm::Type *, unsigned > clang::CodeGen::swiftcall::splitLegalVectorType ( CodeGenModule CGM,
CharUnits  vectorSize,
llvm::VectorType *  vectorTy 
)

Minimally split a legal vector type.

Definition at line 702 of file SwiftCallingConv.cpp.

References isLegalVectorType(), and isPowerOf2().