10#include "TargetInfo.h"
37 if (sz < State.FreeRegs)
54 updateState(I.info, I.type, State);
72 return HasFreeRegs ? getNaturalAlignIndirectInReg(Ty) :
73 getNaturalAlignIndirect(Ty,
false);
78 const unsigned MinABIStackAlignInBytes = 4;
79 unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8;
81 TypeAlign > MinABIStackAlignInBytes);
87 getContext().getTypeInfoInChars(Ty),
92 uint8_t FreeRegs)
const {
98 return getIndirectByRef(Ty, FreeRegs > 0);
101 return getIndirectByValue(Ty);
106 Ty = EnumTy->getDecl()->getIntegerType();
108 auto SizeInRegs = llvm::alignTo(getContext().getTypeSize(Ty), 32) / 32;
113 return getIndirectByValue(Ty);
119 llvm::LLVMContext &LLVMContext = getVMContext();
121 llvm::IntegerType *
Int32 = llvm::Type::getInt32Ty(LLVMContext);
123 llvm::Type *Result = llvm::StructType::get(LLVMContext, Elements);
125 return FreeRegs >= SizeInRegs ?
131 if (EIT->getNumBits() > 64)
132 return getIndirectByValue(Ty);
134 return isPromotableIntegerTypeForABI(Ty)
137 : (FreeRegs >= SizeInRegs ?
ABIArgInfo::getDirectInReg()
146 auto RetSize = llvm::alignTo(getContext().getTypeSize(RetTy), 32) / 32;
148 return getIndirectByRef(RetTy,
true);
155std::unique_ptr<TargetCodeGenInfo>
157 return std::make_unique<ARCTargetCodeGenInfo>(CGM.
getTypes());
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
A fixed int type of a specified bitwidth.
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to ...
static ABIArgInfo getIgnore()
static ABIArgInfo getExtendInReg(QualType Ty, llvm::Type *T=nullptr)
static ABIArgInfo getIndirect(CharUnits Alignment, bool ByVal=true, bool Realign=false, llvm::Type *Padding=nullptr)
static ABIArgInfo getDirectInReg(llvm::Type *T=nullptr)
CodeGen::CGCXXABI & getCXXABI() const
ASTContext & getContext() const
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
RecordArgABI
Specify how one should pass an argument of a record type.
@ RAA_Indirect
Pass it as a pointer to temporary memory.
@ RAA_DirectInMemory
Pass it on the stack using its defined layout.
CGFunctionInfo - Class to encapsulate the information about a function definition.
ABIArgInfo & getReturnInfo()
CanQualType getReturnType() const
MutableArrayRef< ArgInfo > arguments()
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
This class organizes the cross-function state that is used while generating LLVM code.
CodeGenTypes & getTypes()
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
DefaultABIInfo - The default implementation for ABI specific details.
DefaultABIInfo(CodeGen::CodeGenTypes &CGT)
ABIArgInfo classifyArgumentType(QualType RetTy) const
RValue EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, AggValueSlot Slot) const override
EmitVAArg - Emit the target dependent code to load a value of.
ABIArgInfo classifyReturnType(QualType RetTy) const
void computeInfo(CGFunctionInfo &FI) const override
RValue - This trivial value class is used to represent the result of an expression that is evaluated.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
A (possibly-)qualified type.
bool hasFlexibleArrayMember() const
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
RecordDecl * getDecl() const
bool isAnyComplexType() const
const T * getAs() const
Member-template getAs<specific type>'.
CGCXXABI::RecordArgABI getRecordArgABI(const RecordType *RT, CGCXXABI &CXXABI)
RValue emitVoidPtrVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType ValueTy, bool IsIndirect, TypeInfoChars ValueInfo, CharUnits SlotSizeAndAlign, bool AllowHigherAlign, AggValueSlot Slot, bool ForceRightAdjust=false)
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted ...
bool isAggregateTypeForABI(QualType T)
std::unique_ptr< TargetCodeGenInfo > createARCTargetCodeGenInfo(CodeGenModule &CGM)
bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, bool AsIfNoUniqueAddr=false)
isEmptyRecord - Return true iff a structure contains only empty fields.
The JSON file list parser is used to communicate input to InstallAPI.