clang 20.0.0git
Functions
SwiftCallingConv.cpp File Reference
#include "clang/CodeGen/SwiftCallingConv.h"
#include "ABIInfo.h"
#include "CodeGenModule.h"
#include "TargetInfo.h"
#include "clang/Basic/TargetInfo.h"
#include <optional>

Go to the source code of this file.

Functions

static const SwiftABIInfogetSwiftABIInfo (CodeGenModule &CGM)
 
static bool isPowerOf2 (unsigned n)
 
static llvm::TypegetCommonType (llvm::Type *first, llvm::Type *second)
 Given two types with the same size, try to find a common type.
 
static CharUnits getTypeStoreSize (CodeGenModule &CGM, llvm::Type *type)
 
static CharUnits getTypeAllocSize (CodeGenModule &CGM, llvm::Type *type)
 
static CharUnits getOffsetAtStartOfUnit (CharUnits offset, CharUnits unitSize)
 Given a power-of-two unit size, return the offset of the aligned unit of that size which contains the given offset.
 
static bool areBytesInSameUnit (CharUnits first, CharUnits second, CharUnits chunkSize)
 
static bool isMergeableEntryType (llvm::Type *type)
 
static ABIArgInfo classifyExpandedType (SwiftAggLowering &lowering, bool forReturn, CharUnits alignmentForIndirect)
 
static ABIArgInfo classifyType (CodeGenModule &CGM, CanQualType type, bool forReturn)
 

Function Documentation

◆ areBytesInSameUnit()

static bool areBytesInSameUnit ( CharUnits  first,
CharUnits  second,
CharUnits  chunkSize 
)
static

Definition at line 430 of file SwiftCallingConv.cpp.

References getOffsetAtStartOfUnit().

◆ classifyExpandedType()

static ABIArgInfo classifyExpandedType ( SwiftAggLowering lowering,
bool  forReturn,
CharUnits  alignmentForIndirect 
)
static

◆ classifyType()

static ABIArgInfo classifyType ( CodeGenModule CGM,
CanQualType  type,
bool  forReturn 
)
static

◆ getCommonType()

static llvm::Type * getCommonType ( llvm::Type first,
llvm::Type second 
)
static

Given two types with the same size, try to find a common type.

Definition at line 33 of file SwiftCallingConv.cpp.

References getCommonType().

Referenced by getCommonType().

◆ getOffsetAtStartOfUnit()

static CharUnits getOffsetAtStartOfUnit ( CharUnits  offset,
CharUnits  unitSize 
)
static

Given a power-of-two unit size, return the offset of the aligned unit of that size which contains the given offset.

In other words, round down to the nearest multiple of the unit size.

Definition at line 424 of file SwiftCallingConv.cpp.

References clang::CharUnits::fromQuantity(), clang::CharUnits::getQuantity(), and isPowerOf2().

Referenced by areBytesInSameUnit(), and clang::CodeGen::swiftcall::SwiftAggLowering::finish().

◆ getSwiftABIInfo()

static const SwiftABIInfo & getSwiftABIInfo ( CodeGenModule CGM)
static

◆ getTypeAllocSize()

static CharUnits getTypeAllocSize ( CodeGenModule CGM,
llvm::Type type 
)
static

◆ getTypeStoreSize()

static CharUnits getTypeStoreSize ( CodeGenModule CGM,
llvm::Type type 
)
static

◆ isMergeableEntryType()

static bool isMergeableEntryType ( llvm::Type type)
static

Definition at line 436 of file SwiftCallingConv.cpp.

References clang::ast_matchers::type.

◆ isPowerOf2()

static bool isPowerOf2 ( unsigned  n)
static