10#include "TargetInfo.h"
12#include "llvm/TargetParser/AArch64TargetParser.h"
23class AArch64ABIInfo :
public ABIInfo {
38 unsigned CallingConvention)
const;
42 uint64_t Members)
const override;
45 bool isIllegalVectorType(
QualType Ty)
const;
66 if (isa<llvm::ScalableVectorType>(BaseTy))
67 llvm::report_fatal_error(
"Passing SVE types to variadic functions is "
68 "currently not supported");
71 : isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF)
72 : EmitAAPCSVAArg(VAListAddr, Ty, CGF,
Kind);
84 raw_ostream &Out)
const override;
86 raw_ostream &Out)
const override;
95 unsigned NumElts)
const override;
102 SwiftInfo = std::make_unique<AArch64SwiftABIInfo>(CGT);
106 return "mov\tfp, fp\t\t// marker for objc_retainAutoreleaseReturnValue";
117 const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D);
121 const auto *TA = FD->
getAttr<TargetAttr>();
127 if (
Attr.BranchProtection.empty())
133 Attr.CPU, BPI, Error);
134 assert(
Error.empty());
136 auto *Fn = cast<llvm::Function>(GV);
139 if (BPI.
SignReturnAddr != LangOptions::SignReturnAddressScopeKind::None) {
140 Fn->addFnAttr(
"sign-return-address-key",
141 BPI.
SignKey == LangOptions::SignReturnAddressKeyKind::AKey
146 Fn->addFnAttr(
"branch-target-enforcement",
148 Fn->addFnAttr(
"branch-protection-pauth-lr",
150 Fn->addFnAttr(
"guarded-control-stack",
155 llvm::Type *Ty)
const override {
157 auto *ST = dyn_cast<llvm::StructType>(Ty);
158 if (ST && ST->getNumElements() == 1) {
159 auto *AT = dyn_cast<llvm::ArrayType>(ST->getElementType(0));
160 if (AT && AT->getNumElements() == 8 &&
161 AT->getElementType()->isIntegerTy(64))
177class WindowsAArch64TargetCodeGenInfo :
public AArch64TargetCodeGenInfo {
180 : AArch64TargetCodeGenInfo(CGT, K) {}
182 void setTargetAttributes(
const Decl *D, llvm::GlobalValue *GV,
185 void getDependentLibraryOption(llvm::StringRef Lib,
187 Opt =
"/DEFAULTLIB:" + qualifyWindowsLibrary(Lib);
190 void getDetectMismatchOption(llvm::StringRef Name, llvm::StringRef
Value,
192 Opt =
"/FAILIFMISMATCH:\"" + Name.str() +
"=" +
Value.str() +
"\"";
196void WindowsAArch64TargetCodeGenInfo::setTargetAttributes(
198 AArch64TargetCodeGenInfo::setTargetAttributes(D, GV, CGM);
199 if (GV->isDeclaration())
201 addStackProbeTargetAttributes(D, GV, CGM);
209 if (VT->getVectorKind() == VectorKind::SveFixedLengthPredicate) {
210 assert(VT->getElementType()->isBuiltinType() &&
"expected builtin type!");
212 BuiltinType::UChar &&
213 "unexpected builtin type for SVE predicate!");
215 llvm::Type::getInt1Ty(getVMContext()), 16));
218 if (VT->getVectorKind() == VectorKind::SveFixedLengthData) {
219 assert(VT->getElementType()->isBuiltinType() &&
"expected builtin type!");
221 const auto *BT = VT->getElementType()->castAs<
BuiltinType>();
222 llvm::ScalableVectorType *ResType =
nullptr;
223 switch (BT->getKind()) {
225 llvm_unreachable(
"unexpected builtin type for SVE vector!");
226 case BuiltinType::SChar:
227 case BuiltinType::UChar:
228 ResType = llvm::ScalableVectorType::get(
229 llvm::Type::getInt8Ty(getVMContext()), 16);
231 case BuiltinType::Short:
232 case BuiltinType::UShort:
233 ResType = llvm::ScalableVectorType::get(
234 llvm::Type::getInt16Ty(getVMContext()), 8);
236 case BuiltinType::Int:
237 case BuiltinType::UInt:
238 ResType = llvm::ScalableVectorType::get(
239 llvm::Type::getInt32Ty(getVMContext()), 4);
241 case BuiltinType::Long:
242 case BuiltinType::ULong:
243 ResType = llvm::ScalableVectorType::get(
244 llvm::Type::getInt64Ty(getVMContext()), 2);
246 case BuiltinType::Half:
247 ResType = llvm::ScalableVectorType::get(
248 llvm::Type::getHalfTy(getVMContext()), 8);
250 case BuiltinType::Float:
251 ResType = llvm::ScalableVectorType::get(
252 llvm::Type::getFloatTy(getVMContext()), 4);
254 case BuiltinType::Double:
255 ResType = llvm::ScalableVectorType::get(
256 llvm::Type::getDoubleTy(getVMContext()), 2);
258 case BuiltinType::BFloat16:
259 ResType = llvm::ScalableVectorType::get(
260 llvm::Type::getBFloatTy(getVMContext()), 8);
268 if ((isAndroid() || isOHOSFamily()) && (Size <= 16)) {
269 llvm::Type *ResType = llvm::Type::getInt16Ty(getVMContext());
273 llvm::Type *ResType = llvm::Type::getInt32Ty(getVMContext());
278 llvm::FixedVectorType::get(llvm::Type::getInt32Ty(getVMContext()), 2);
283 llvm::FixedVectorType::get(llvm::Type::getInt32Ty(getVMContext()), 4);
286 return getNaturalAlignIndirect(Ty,
false);
290AArch64ABIInfo::classifyArgumentType(
QualType Ty,
bool IsVariadic,
291 unsigned CallingConvention)
const {
295 if (isIllegalVectorType(Ty))
296 return coerceIllegalVector(Ty);
301 Ty = EnumTy->getDecl()->getIntegerType();
304 if (EIT->getNumBits() > 128)
305 return getNaturalAlignIndirect(Ty);
307 return (isPromotableIntegerTypeForABI(Ty) && isDarwinPCS()
315 return getNaturalAlignIndirect(Ty, RAA ==
323 if (IsEmpty || Size == 0) {
324 if (!getContext().getLangOpts().
CPlusPlus || isDarwinPCS())
329 if (IsEmpty && Size == 0)
337 bool IsWin64 =
Kind == AArch64ABIKind::Win64 ||
338 CallingConvention == llvm::CallingConv::Win64;
339 bool IsWinVariadic = IsWin64 && IsVariadic;
342 if (!IsWinVariadic && isHomogeneousAggregate(Ty,
Base, Members)) {
343 if (Kind != AArch64ABIKind::AAPCS)
345 llvm::ArrayType::get(CGT.ConvertType(
QualType(
Base, 0)), Members));
350 getContext().getTypeUnadjustedAlignInChars(Ty).getQuantity();
351 Align = (Align >= 16) ? 16 : 8;
353 llvm::ArrayType::get(CGT.ConvertType(
QualType(
Base, 0)), Members), 0,
354 nullptr,
true, Align);
361 if (getTarget().isRenderScriptTarget()) {
365 if (Kind == AArch64ABIKind::AAPCS) {
366 Alignment = getContext().getTypeUnadjustedAlign(Ty);
367 Alignment = Alignment < 128 ? 64 : 128;
370 std::max(getContext().getTypeAlign(Ty),
371 (
unsigned)getTarget().getPointerWidth(LangAS::Default));
373 Size = llvm::alignTo(Size, Alignment);
377 llvm::Type *BaseTy = llvm::Type::getIntNTy(getVMContext(), Alignment);
379 Size == Alignment ? BaseTy
380 : llvm::ArrayType::get(BaseTy, Size / Alignment));
383 return getNaturalAlignIndirect(Ty,
false);
387 bool IsVariadic)
const {
392 if (VT->getVectorKind() == VectorKind::SveFixedLengthData ||
393 VT->getVectorKind() == VectorKind::SveFixedLengthPredicate)
394 return coerceIllegalVector(RetTy);
398 if (RetTy->
isVectorType() && getContext().getTypeSize(RetTy) > 128)
399 return getNaturalAlignIndirect(RetTy);
404 RetTy = EnumTy->getDecl()->getIntegerType();
407 if (EIT->getNumBits() > 128)
408 return getNaturalAlignIndirect(RetTy);
410 return (isPromotableIntegerTypeForABI(RetTy) && isDarwinPCS()
421 if (isHomogeneousAggregate(RetTy,
Base, Members) &&
422 !(getTarget().getTriple().getArch() == llvm::Triple::aarch64_32 &&
431 if (getTarget().isRenderScriptTarget()) {
435 if (Size <= 64 && getDataLayout().isLittleEndian()) {
443 llvm::IntegerType::get(getVMContext(), Size));
446 unsigned Alignment = getContext().getTypeAlign(RetTy);
447 Size = llvm::alignTo(Size, 64);
451 if (Alignment < 128 && Size == 128) {
452 llvm::Type *BaseTy = llvm::Type::getInt64Ty(getVMContext());
458 return getNaturalAlignIndirect(RetTy);
462bool AArch64ABIInfo::isIllegalVectorType(
QualType Ty)
const {
467 if (VT->getVectorKind() == VectorKind::SveFixedLengthData ||
468 VT->getVectorKind() == VectorKind::SveFixedLengthPredicate)
472 unsigned NumElements = VT->getNumElements();
475 if (!llvm::isPowerOf2_32(NumElements))
480 llvm::Triple Triple = getTarget().getTriple();
481 if (Triple.getArch() == llvm::Triple::aarch64_32 &&
482 Triple.isOSBinFormatMachO())
485 return Size != 64 && (
Size != 128 || NumElements == 1);
490bool AArch64SwiftABIInfo::isLegalVectorType(
CharUnits VectorSize,
492 unsigned NumElts)
const {
493 if (!llvm::isPowerOf2_32(NumElts))
501bool AArch64ABIInfo::isHomogeneousAggregateBaseType(
QualType Ty)
const {
504 if (Kind == AArch64ABIKind::AAPCSSoft)
512 if (BT->isFloatingPoint())
515 unsigned VecSize = getContext().getTypeSize(VT);
516 if (VecSize == 64 || VecSize == 128)
522bool AArch64ABIInfo::isHomogeneousAggregateSmallEnough(
const Type *
Base,
523 uint64_t Members)
const {
527bool AArch64ABIInfo::isZeroLengthBitfieldPermittedInHomogeneousAggregate()
544 uint64_t PointerSize = getTarget().getPointerWidth(LangAS::Default) / 8;
555 BaseTy = llvm::PointerType::getUnqual(BaseTy);
559 unsigned NumRegs = 1;
560 if (llvm::ArrayType *ArrTy = dyn_cast<llvm::ArrayType>(BaseTy)) {
561 BaseTy = ArrTy->getElementType();
562 NumRegs = ArrTy->getNumElements();
564 bool IsFPR =
Kind != AArch64ABIKind::AAPCSSoft &&
565 (BaseTy->isFloatingPointTy() || BaseTy->isVectorTy());
583 CharUnits TySize = getContext().getTypeSizeInChars(Ty);
584 CharUnits TyAlign = getContext().getTypeUnadjustedAlignInChars(Ty);
587 llvm::Value *reg_offs =
nullptr;
589 int RegSize = IsIndirect ? 8 : TySize.
getQuantity();
595 RegSize = llvm::alignTo(RegSize, 8);
601 RegSize = 16 * NumRegs;
612 llvm::Value *UsingStack =
nullptr;
613 UsingStack = CGF.
Builder.CreateICmpSGE(
614 reg_offs, llvm::ConstantInt::get(CGF.
Int32Ty, 0));
616 CGF.
Builder.CreateCondBr(UsingStack, OnStackBlock, MaybeRegBlock);
625 if (!IsFPR && !IsIndirect && TyAlign.
getQuantity() > 8) {
628 reg_offs = CGF.
Builder.CreateAdd(
629 reg_offs, llvm::ConstantInt::get(CGF.
Int32Ty, Align - 1),
631 reg_offs = CGF.
Builder.CreateAnd(
632 reg_offs, llvm::ConstantInt::get(CGF.
Int32Ty, -Align),
640 llvm::Value *NewOffset =
nullptr;
641 NewOffset = CGF.
Builder.CreateAdd(
642 reg_offs, llvm::ConstantInt::get(CGF.
Int32Ty, RegSize),
"new_reg_offs");
647 llvm::Value *InRegs =
nullptr;
648 InRegs = CGF.
Builder.CreateICmpSLE(
649 NewOffset, llvm::ConstantInt::get(CGF.
Int32Ty, 0),
"inreg");
651 CGF.
Builder.CreateCondBr(InRegs, InRegBlock, OnStackBlock);
661 llvm::Value *reg_top =
nullptr;
673 MemTy = llvm::PointerType::getUnqual(MemTy);
678 bool IsHFA = isHomogeneousAggregate(Ty,
Base, NumMembers);
679 if (IsHFA && NumMembers > 1) {
684 assert(!IsIndirect &&
"Homogeneous aggregates should be passed directly");
685 auto BaseTyInfo = getContext().getTypeInfoInChars(
QualType(
Base, 0));
687 llvm::Type *HFATy = llvm::ArrayType::get(BaseTy, NumMembers);
689 std::max(TyAlign, BaseTyInfo.Align));
694 BaseTyInfo.Width.getQuantity() < 16)
695 Offset = 16 - BaseTyInfo.Width.getQuantity();
697 for (
unsigned i = 0; i < NumMembers; ++i) {
714 CharUnits SlotSize = BaseAddr.getAlignment();
742 OnStackPtr = CGF.
Builder.CreateAdd(
743 OnStackPtr, llvm::ConstantInt::get(CGF.
Int64Ty, Align - 1),
745 OnStackPtr = CGF.
Builder.CreateAnd(
746 OnStackPtr, llvm::ConstantInt::get(CGF.
Int64Ty, -Align),
758 StackSize = StackSlotSize;
760 StackSize = TySize.
alignTo(StackSlotSize);
764 CGF.
Int8Ty, OnStackPtr, StackSizeC,
"new_stack");
770 TySize < StackSlotSize) {
771 CharUnits Offset = StackSlotSize - TySize;
785 OnStackBlock,
"vaargs.addr");
802 uint64_t PointerSize = getTarget().getPointerWidth(LangAS::Default) / 8;
812 auto TyInfo = getContext().getTypeInfoInChars(Ty);
816 bool IsIndirect =
false;
817 if (TyInfo.Width.getQuantity() > 16) {
820 IsIndirect = !isHomogeneousAggregate(Ty,
Base, Members);
824 TyInfo, SlotSize,
true);
829 bool IsIndirect =
false;
842 if (F->
hasAttr<ArmLocallyStreamingAttr>())
856void AArch64TargetCodeGenInfo::checkFunctionABI(
858 const AArch64ABIInfo &
ABIInfo = getABIInfo<AArch64ABIInfo>();
866 const Type *HABase =
nullptr;
868 if (Ty->isFloatingType() || Ty->isVectorType() ||
871 diag::err_target_unsupported_type_for_abi)
872 << D->getDeclName() << Ty << TI.getABI();
876 if (!TI.hasFeature(
"fp") && !
ABIInfo.isSoftFloat()) {
879 CheckType(PVD->getType(), PVD);
884void AArch64TargetCodeGenInfo::checkFunctionCallABI(
887 if (!Caller || !Callee || !
Callee->hasAttr<AlwaysInlineAttr>())
895 if (!CalleeIsStreamingCompatible &&
896 (CallerIsStreaming != CalleeIsStreaming || CallerIsStreamingCompatible))
898 diag::err_function_always_inline_attribute_mismatch)
900 if (
auto *NewAttr =
Callee->getAttr<ArmNewAttr>())
901 if (NewAttr->isNewZA())
902 CGM.
getDiags().
Report(CallLoc, diag::err_function_always_inline_new_za)
906void AArch64ABIInfo::appendAttributeMangling(TargetClonesAttr *
Attr,
908 raw_ostream &Out)
const {
909 appendAttributeMangling(
Attr->getFeatureStr(Index), Out);
912void AArch64ABIInfo::appendAttributeMangling(StringRef AttrStr,
913 raw_ostream &Out)
const {
914 if (AttrStr ==
"default") {
921 AttrStr.split(Features,
"+");
922 for (
auto &Feat : Features)
925 llvm::sort(Features, [](
const StringRef LHS,
const StringRef RHS) {
926 return LHS.compare(RHS) < 0;
929 llvm::SmallDenseSet<StringRef, 8> UniqueFeats;
930 for (
auto &Feat : Features)
931 if (
auto Ext = llvm::AArch64::parseArchExtension(Feat))
932 if (UniqueFeats.insert(Ext->Name).second)
933 Out <<
'M' << Ext->Name;
936std::unique_ptr<TargetCodeGenInfo>
939 return std::make_unique<AArch64TargetCodeGenInfo>(CGM.
getTypes(), Kind);
942std::unique_ptr<TargetCodeGenInfo>
945 return std::make_unique<WindowsAArch64TargetCodeGenInfo>(CGM.
getTypes(), K);
static bool isStreamingCompatible(const FunctionDecl *F)
static bool isStreaming(const FunctionDecl *F)
TypeInfoChars getTypeInfoInChars(const Type *T) const
const TargetInfo & getTargetInfo() const
Attr - This represents one attribute.
A fixed int type of a specified bitwidth.
This class is used for builtin types like 'int'.
CharUnits - This is an opaque type for sizes expressed in character units.
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
CharUnits alignTo(const CharUnits &Align) const
alignTo - Returns the next integer (mod 2**64) that is greater than or equal to this quantity and is ...
ABIArgInfo - Helper class to encapsulate information about how a specific C type should be passed to ...
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 * getCoerceToType() const
ABIInfo - Target specific hooks for defining how a type should be passed or returned from functions.
virtual bool allowBFloatArgsAndRet() const
virtual CodeGen::Address EmitMSVAArg(CodeGen::CodeGenFunction &CGF, CodeGen::Address VAListAddr, QualType Ty) const
Emit the target dependent code to load a value of.
bool isHomogeneousAggregate(QualType Ty, const Type *&Base, uint64_t &Members) const
isHomogeneousAggregate - Return true if a type is an ELFv2 homogeneous aggregate.
CodeGen::CGCXXABI & getCXXABI() const
ASTContext & getContext() const
virtual bool isHomogeneousAggregateBaseType(QualType Ty) const
virtual void appendAttributeMangling(TargetAttr *Attr, raw_ostream &Out) const
virtual CodeGen::Address EmitVAArg(CodeGen::CodeGenFunction &CGF, CodeGen::Address VAListAddr, QualType Ty) const =0
EmitVAArg - Emit the target dependent code to load a value of.
virtual bool isHomogeneousAggregateSmallEnough(const Type *Base, uint64_t Members) const
const TargetInfo & getTarget() const
virtual bool isZeroLengthBitfieldPermittedInHomogeneousAggregate() const
virtual void computeInfo(CodeGen::CGFunctionInfo &FI) const =0
Like RawAddress, an abstract representation of an aligned address, but the pointer contained in this ...
Address withElementType(llvm::Type *ElemTy) const
Return address with different element type, but same pointer and alignment.
llvm::StoreInst * CreateStore(llvm::Value *Val, Address Addr, bool IsVolatile=false)
Address CreateConstInBoundsByteGEP(Address Addr, CharUnits Offset, const llvm::Twine &Name="")
Given a pointer to i8, adjust it by a given constant offset.
Address CreateConstArrayGEP(Address Addr, uint64_t Index, const llvm::Twine &Name="")
Given addr = [n x T]* ... produce name = getelementptr inbounds addr, i64 0, i64 index where i64 is a...
Address CreateStructGEP(Address Addr, unsigned Index, const llvm::Twine &Name="")
llvm::LoadInst * CreateLoad(Address Addr, const llvm::Twine &Name="")
llvm::ConstantInt * getSize(CharUnits N)
Address CreateInBoundsGEP(Address Addr, ArrayRef< llvm::Value * > IdxList, llvm::Type *ElementType, CharUnits Align, const Twine &Name="")
RecordArgABI
Specify how one should pass an argument of a record type.
@ RAA_DirectInMemory
Pass it on the stack using its defined layout.
CGFunctionInfo - Class to encapsulate the information about a function definition.
ABIArgInfo & getReturnInfo()
unsigned getCallingConvention() const
getCallingConvention - Return the user specified calling convention, which has been translated into a...
CanQualType getReturnType() const
MutableArrayRef< ArgInfo > arguments()
CallArgList - Type for representing both the value and type of arguments in a call.
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
llvm::BasicBlock * createBasicBlock(const Twine &name="", llvm::Function *parent=nullptr, llvm::BasicBlock *before=nullptr)
createBasicBlock - Create an LLVM basic block.
void EmitBlock(llvm::BasicBlock *BB, bool IsFinished=false)
EmitBlock - Emit the given block.
llvm::AllocaInst * CreateTempAlloca(llvm::Type *Ty, const Twine &Name="tmp", llvm::Value *ArraySize=nullptr)
CreateTempAlloca - This creates an alloca and inserts it into the entry block if ArraySize is nullptr...
llvm::Type * ConvertTypeForMem(QualType T)
const TargetInfo & getTarget() const
void EmitBranch(llvm::BasicBlock *Block)
EmitBranch - Emit a branch to the specified basic block from the current insert block,...
ASTContext & getContext() const
llvm::Type * ConvertType(QualType T)
const CGFunctionInfo * CurFnInfo
This class organizes the cross-function state that is used while generating LLVM code.
DiagnosticsEngine & getDiags() const
CodeGenTypes & getTypes()
const TargetInfo & getTarget() const
const llvm::DataLayout & getDataLayout() const
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
Target specific hooks for defining how a type should be passed or returned from functions with one of...
virtual bool isLegalVectorType(CharUnits VectorSize, llvm::Type *EltTy, unsigned NumElts) const
Returns true if the given vector type is legal from Swift's calling convention perspective.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
virtual bool doesReturnSlotInterfereWithArgs() const
doesReturnSlotInterfereWithArgs - Return true if the target uses an argument slot for an 'sret' type.
virtual StringRef getARCRetainAutoreleasedReturnValueMarker() const
Retrieve the address of a function to call immediately before calling objc_retainAutoreleasedReturnVa...
virtual void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const
setTargetAttributes - Provides a convenient hook to handle extra target-specific attributes for the g...
virtual void checkFunctionABI(CodeGenModule &CGM, const FunctionDecl *Decl) const
Any further codegen related checks that need to be done on a function signature in a target specific ...
virtual bool isScalarizableAsmOperand(CodeGen::CodeGenFunction &CGF, llvm::Type *Ty) const
Target hook to decide whether an inline asm operand can be passed by value.
virtual int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const
Determines the DWARF register number for the stack pointer, for exception-handling purposes.
virtual void checkFunctionCallABI(CodeGenModule &CGM, SourceLocation CallLoc, const FunctionDecl *Caller, const FunctionDecl *Callee, const CallArgList &Args) const
Any further codegen related checks that need to be done on a function call in a target specific manne...
Decl - This represents one declaration (or definition), e.g.
SourceLocation getLocation() const
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
Represents a function declaration or definition.
QualType getReturnType() const
ArrayRef< ParmVarDecl * > parameters() const
Represents a prototype with parameter type info, e.g.
unsigned getAArch64SMEAttributes() const
Return a bitmask describing the SME attributes on the function type, see AArch64SMETypeAttributes for...
@ SME_PStateSMEnabledMask
@ SME_PStateSMCompatibleMask
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a parameter to a function.
A (possibly-)qualified type.
Encodes a location in the source.
Exposes information about the current target.
virtual ParsedTargetAttr parseTargetAttr(StringRef Str) const
virtual bool hasBFloat16Type() const
Determine whether the _BFloat16 type is supported on this target.
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
virtual bool validateBranchProtection(StringRef Spec, StringRef Arch, BranchProtectionInfo &BPI, StringRef &Err) const
Determine if this TargetInfo supports the given branch protection specification.
The base class of the type hierarchy.
const T * castAs() const
Member-template castAs<specific type>.
bool isVectorType() const
const T * getAs() const
Member-template getAs<specific type>'.
Represents a GCC generic vector type.
ABIArgInfo classifyArgumentType(CodeGenModule &CGM, CanQualType type)
Classify the rules for how to pass a particular type.
CGCXXABI::RecordArgABI getRecordArgABI(const RecordType *RT, CGCXXABI &CXXABI)
bool classifyReturnType(const CGCXXABI &CXXABI, CGFunctionInfo &FI, const ABIInfo &Info)
Address EmitVAArgInstr(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, const ABIArgInfo &AI)
Address emitVoidPtrVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType ValueTy, bool IsIndirect, TypeInfoChars ValueInfo, CharUnits SlotSizeAndAlign, bool AllowHigherAlign, bool ForceRightAdjust=false)
Emit va_arg for a platform using the common void* representation, where arguments are simply emitted ...
Address emitMergePHI(CodeGenFunction &CGF, Address Addr1, llvm::BasicBlock *Block1, Address Addr2, llvm::BasicBlock *Block2, const llvm::Twine &Name="")
ABIArgInfo coerceToIntArray(QualType Ty, ASTContext &Context, llvm::LLVMContext &LLVMContext)
bool isAggregateTypeForABI(QualType T)
std::unique_ptr< TargetCodeGenInfo > createAArch64TargetCodeGenInfo(CodeGenModule &CGM, AArch64ABIKind Kind)
QualType useFirstFieldIfTransparentUnion(QualType Ty)
Pass transparent unions as if they were the type of the first element.
std::unique_ptr< TargetCodeGenInfo > createWindowsAArch64TargetCodeGenInfo(CodeGenModule &CGM, AArch64ABIKind K)
bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays, bool AsIfNoUniqueAddr=false)
isEmptyRecord - Return true iff a structure contains only empty fields.
bool Load(InterpState &S, CodePtr OpPC)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
llvm::IntegerType * Int64Ty
llvm::IntegerType * Int8Ty
i8, i16, i32, and i64
llvm::IntegerType * Int32Ty
llvm::PointerType * Int8PtrTy
Contains information gathered from parsing the contents of TargetAttr.
LangOptions::SignReturnAddressScopeKind SignReturnAddr
LangOptions::SignReturnAddressKeyKind SignKey
bool BranchProtectionPAuthLR
bool BranchTargetEnforcement
const char * getSignReturnAddrStr() const