clang
8.0.0
|
#include "clang/CodeGen/SwiftCallingConv.h"
Public Types | |
using | EnumerationCallback = llvm::function_ref< void(CharUnits offset, CharUnits end, llvm::Type *type)> |
Public Member Functions | |
SwiftAggLowering (CodeGenModule &CGM) | |
void | addOpaqueData (CharUnits begin, CharUnits end) |
void | addTypedData (QualType type, CharUnits begin) |
void | addTypedData (const RecordDecl *record, CharUnits begin) |
void | addTypedData (const RecordDecl *record, CharUnits begin, const ASTRecordLayout &layout) |
void | addTypedData (llvm::Type *type, CharUnits begin) |
void | addTypedData (llvm::Type *type, CharUnits begin, CharUnits end) |
void | finish () |
bool | empty () const |
Does this lowering require passing any data? More... | |
bool | shouldPassIndirectly (bool asReturnValue) const |
According to the target Swift ABI, should a value with this lowering be passed indirectly? More... | |
void | enumerateComponents (EnumerationCallback callback) const |
Enumerate the expanded components of this type. More... | |
std::pair< llvm::StructType *, llvm::Type * > | getCoerceAndExpandTypes () const |
Return the types for a coerce-and-expand operation. More... | |
Definition at line 42 of file SwiftCallingConv.h.
using clang::CodeGen::swiftcall::SwiftAggLowering::EnumerationCallback = llvm::function_ref<void(CharUnits offset, CharUnits end, llvm::Type *type)> |
Definition at line 93 of file SwiftCallingConv.h.
|
inline |
Definition at line 58 of file SwiftCallingConv.h.
|
inline |
Definition at line 60 of file SwiftCallingConv.h.
Referenced by addTypedData().
Definition at line 64 of file SwiftCallingConv.cpp.
References addOpaqueData(), clang::ast_matchers::arrayType, clang::ast_matchers::complexType, clang::CodeGen::CodeGenTypes::ConvertType(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getTypes(), clang::ASTContext::getTypeSizeInChars(), and clang::Type::isArrayType().
Referenced by addTypedData(), and classifyType().
void SwiftAggLowering::addTypedData | ( | const RecordDecl * | record, |
CharUnits | begin | ||
) |
Definition at line 106 of file SwiftCallingConv.cpp.
References addTypedData(), clang::ASTContext::getASTRecordLayout(), and clang::CodeGen::CodeGenModule::getContext().
void SwiftAggLowering::addTypedData | ( | const RecordDecl * | record, |
CharUnits | begin, | ||
const ASTRecordLayout & | layout | ||
) |
Definition at line 110 of file SwiftCallingConv.cpp.
References addOpaqueData(), addTypedData(), clang::RecordDecl::fields(), clang::ASTRecordLayout::getBaseClassOffset(), clang::FieldDecl::getBitWidthValue(), clang::CodeGen::CodeGenModule::getContext(), clang::ASTRecordLayout::getFieldOffset(), clang::ASTRecordLayout::getVBaseClassOffset(), clang::ASTRecordLayout::getVBPtrOffset(), clang::ASTRecordLayout::hasOwnVBPtr(), clang::ASTRecordLayout::hasOwnVFPtr(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::FieldDecl::isBitField(), clang::TagDecl::isUnion(), clang::CharUnits::One(), and clang::ASTContext::toCharUnitsFromBits().
void SwiftAggLowering::addTypedData | ( | llvm::Type * | type, |
CharUnits | begin | ||
) |
Definition at line 194 of file SwiftCallingConv.cpp.
References addTypedData(), and getTypeStoreSize().
void SwiftAggLowering::addTypedData | ( | llvm::Type * | type, |
CharUnits | begin, | ||
CharUnits | end | ||
) |
Definition at line 199 of file SwiftCallingConv.cpp.
References addOpaqueData(), Begin, End, getCommonType(), clang::CodeGen::swiftcall::getNaturalAlignment(), getTypeStoreSize(), clang::CodeGen::swiftcall::isLegalIntegerType(), clang::CharUnits::isMultipleOf(), clang::CharUnits::isZero(), clang::CodeGen::swiftcall::legalizeVectorType(), clang::CodeGen::swiftcall::splitLegalVectorType(), and clang::CodeGen::Type.
|
inline |
Does this lowering require passing any data?
Definition at line 74 of file SwiftCallingConv.h.
References clang::CodeGen::swiftcall::shouldPassIndirectly().
Referenced by classifyExpandedType().
void SwiftAggLowering::enumerateComponents | ( | EnumerationCallback | callback | ) | const |
Enumerate the expanded components of this type.
The component types will always be legal vector, floating-point, integer, or pointer types.
Definition at line 543 of file SwiftCallingConv.cpp.
void SwiftAggLowering::finish | ( | ) |
Definition at line 452 of file SwiftCallingConv.cpp.
References Begin, clang::CodeGen::CodeGenModule::getContext(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::CodeGen::swiftcall::getMaximumVoluntaryIntegerSize(), getOffsetAtStartOfUnit(), min(), clang::CharUnits::One(), and clang::ASTContext::toBits().
Referenced by classifyType().
std::pair< llvm::StructType *, llvm::Type * > SwiftAggLowering::getCoerceAndExpandTypes | ( | ) | const |
Return the types for a coerce-and-expand operation.
The first type matches the memory layout of the data that's been added to this structure, including explicit [N x i8] arrays for any internal padding.
The second type removes any internal padding members and, if only one element remains, is simply that element type.
Definition at line 552 of file SwiftCallingConv.cpp.
References clang::CharUnits::fromQuantity(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenModule::getLLVMContext(), getTypeAllocSize(), clang::CodeGen::Type, clang::ast_matchers::type, and clang::CharUnits::Zero().
Referenced by classifyExpandedType().
According to the target Swift ABI, should a value with this lowering be passed indirectly?
Note that this decision is based purely on the data layout of the value and does not consider whether the type is address-only, must be passed indirectly to match a function abstraction pattern, or anything else that is expected to be handled by high-level lowering.
asReturnValue | - if true, answer whether it should be passed indirectly as a return value; if false, answer whether it should be passed indirectly as an argument |
Definition at line 610 of file SwiftCallingConv.cpp.
References getSwiftABIInfo(), and clang::CodeGen::SwiftABIInfo::shouldPassIndirectlyForSwift().
Referenced by classifyExpandedType().