clang 20.0.0git
Classes | Public Types | Public Member Functions | List of all members
clang::CodeGen::swiftcall::SwiftAggLowering Class Reference

#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?
 
bool shouldPassIndirectly (bool asReturnValue) const
 According to the target Swift ABI, should a value with this lowering be passed indirectly?
 
void enumerateComponents (EnumerationCallback callback) const
 Enumerate the expanded components of this type.
 
std::pair< llvm::StructType *, llvm::Type * > getCoerceAndExpandTypes () const
 Return the types for a coerce-and-expand operation.
 

Detailed Description

Definition at line 41 of file SwiftCallingConv.h.

Member Typedef Documentation

◆ EnumerationCallback

using clang::CodeGen::swiftcall::SwiftAggLowering::EnumerationCallback = llvm::function_ref<void(CharUnits offset, CharUnits end, llvm::Type *type)>

Definition at line 91 of file SwiftCallingConv.h.

Constructor & Destructor Documentation

◆ SwiftAggLowering()

clang::CodeGen::swiftcall::SwiftAggLowering::SwiftAggLowering ( CodeGenModule CGM)
inline

Definition at line 57 of file SwiftCallingConv.h.

Member Function Documentation

◆ addOpaqueData()

void clang::CodeGen::swiftcall::SwiftAggLowering::addOpaqueData ( CharUnits  begin,
CharUnits  end 
)
inline

Definition at line 59 of file SwiftCallingConv.h.

Referenced by addTypedData().

◆ addTypedData() [1/5]

void SwiftAggLowering::addTypedData ( const RecordDecl record,
CharUnits  begin 
)

◆ addTypedData() [2/5]

void SwiftAggLowering::addTypedData ( const RecordDecl record,
CharUnits  begin,
const ASTRecordLayout layout 
)

◆ addTypedData() [3/5]

void SwiftAggLowering::addTypedData ( llvm::Type *  type,
CharUnits  begin 
)

◆ addTypedData() [4/5]

void SwiftAggLowering::addTypedData ( llvm::Type *  type,
CharUnits  begin,
CharUnits  end 
)

◆ addTypedData() [5/5]

void SwiftAggLowering::addTypedData ( QualType  type,
CharUnits  begin 
)

◆ empty()

bool clang::CodeGen::swiftcall::SwiftAggLowering::empty ( ) const
inline

Does this lowering require passing any data?

Definition at line 73 of file SwiftCallingConv.h.

Referenced by classifyExpandedType().

◆ enumerateComponents()

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 561 of file SwiftCallingConv.cpp.

◆ finish()

void SwiftAggLowering::finish ( )

◆ getCoerceAndExpandTypes()

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 570 of file SwiftCallingConv.cpp.

References clang::CharUnits::fromQuantity(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenModule::getLLVMContext(), getTypeAllocSize(), clang::ast_matchers::type, and clang::CharUnits::Zero().

Referenced by classifyExpandedType().

◆ shouldPassIndirectly()

bool SwiftAggLowering::shouldPassIndirectly ( bool  asReturnValue) const

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.

Parameters
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 627 of file SwiftCallingConv.cpp.

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

Referenced by classifyExpandedType().


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