10#include "TargetInfo.h"
23 BPFABIInfo(CodeGenTypes &CGT) : DefaultABIInfo(CGT) {}
29 ABIArgInfo classifyAggregateType(QualType Ty)
const {
30 uint64_t Bits = getContext().getTypeSize(Ty);
36 return getNaturalAlignIndirect(Ty, getDataLayout().getAllocaAddrSpace());
41 CoerceTy = llvm::IntegerType::get(getVMContext(), llvm::alignTo(Bits, 8));
43 llvm::Type *RegTy = llvm::IntegerType::get(getVMContext(), 64);
44 CoerceTy = llvm::ArrayType::get(RegTy, 2);
53 return classifyAggregateType(Ty);
56 Ty = ED->getIntegerType();
58 ASTContext &Context = getContext();
59 if (
const auto *EIT = Ty->
getAs<BitIntType>())
61 return getNaturalAlignIndirect(Ty,
62 getDataLayout().getAllocaAddrSpace());
73 return classifyAggregateType(RetTy);
77 RetTy = ED->getIntegerType();
79 ASTContext &Context = getContext();
80 if (
const auto *EIT = RetTy->
getAs<BitIntType>())
82 return getNaturalAlignIndirect(RetTy,
83 getDataLayout().getAllocaAddrSpace());
89 void computeInfo(CGFunctionInfo &FI)
const override {
99 BPFTargetCodeGenInfo(CodeGenTypes &CGT)
100 : TargetCodeGenInfo(std::make_unique<BPFABIInfo>(CGT)) {}
105std::unique_ptr<TargetCodeGenInfo>
107 return std::make_unique<BPFTargetCodeGenInfo>(CGM.
getTypes());
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
static ABIArgInfo getIgnore()
static ABIArgInfo getDirect(llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true, unsigned Align=0)
static ABIArgInfo getExtend(QualType Ty, llvm::Type *T=nullptr, llvm::Type *Padding=nullptr)
ABIArgInfo & getReturnInfo()
CanQualType getReturnType() const
MutableArrayRef< ArgInfo > arguments()
This class organizes the cross-function state that is used while generating LLVM code.
CodeGenTypes & getTypes()
DefaultABIInfo - The default implementation for ABI specific details.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
EnumDecl * getAsEnumDecl() const
Retrieves the EnumDecl this type refers to.
const T * getAs() const
Member-template getAs<specific type>'.
ABIArgInfo classifyArgumentType(CodeGenModule &CGM, CanQualType type)
Classify the rules for how to pass a particular type.
std::unique_ptr< TargetCodeGenInfo > createBPFTargetCodeGenInfo(CodeGenModule &CGM)
bool classifyReturnType(const CGCXXABI &CXXABI, CGFunctionInfo &FI, const ABIInfo &Info)
bool isAggregateTypeForABI(QualType T)
QualType useFirstFieldIfTransparentUnion(QualType Ty)
Pass transparent unions as if they were the type of the first element.
Top level wrappers for InstallAPI frontend operations.