Lines Matching refs:Ty

93     if (llvm::Type *Ty = getCoerceToType())
94 Ty->print(OS);
284 static bool is32Or64BitBasicType(QualType Ty, ASTContext &Context) {
286 if (const ComplexType *CTy = Ty->getAs<ComplexType>())
287 Ty = CTy->getElementType();
292 if (!Ty->getAs<BuiltinType>() && !Ty->hasPointerRepresentation() &&
293 !Ty->isEnumeralType() && !Ty->isBlockPointerType())
296 uint64_t Size = Context.getTypeSize(Ty);
309 static bool canExpandIndirectArgument(QualType Ty, ASTContext &Context) {
311 const RecordType *RT = Ty->getAs<RecordType>();
338 if (Size != Context.getTypeSize(Ty))
363 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
373 llvm::Value *DefaultABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
378 ABIArgInfo DefaultABIInfo::classifyArgumentType(QualType Ty) const {
379 if (isAggregateTypeForABI(Ty))
383 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
384 Ty = EnumTy->getDecl()->getIntegerType();
386 return (Ty->isPromotableIntegerType() ?
420 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
438 llvm::Value *PNaClABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
443 /// \brief Classify argument of given type \p Ty.
444 ABIArgInfo PNaClABIInfo::classifyArgumentType(QualType Ty) const {
445 if (isAggregateTypeForABI(Ty)) {
446 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
449 } else if (const EnumType *EnumTy = Ty->getAs<EnumType>()) {
451 Ty = EnumTy->getDecl()->getIntegerType();
452 } else if (Ty->isFloatingType()) {
457 return (Ty->isPromotableIntegerType() ?
487 llvm::Type* Ty) {
488 if ((Constraint == "y" || Constraint == "&y") && Ty->isVectorTy()) {
489 if (cast<llvm::VectorType>(Ty)->getBitWidth() != 64) {
498 return Ty;
533 bool shouldReturnTypeInRegister(QualType Ty, ASTContext &Context) const;
535 /// getIndirectResult - Give a source type \arg Ty, return a suitable result
537 ABIArgInfo getIndirectResult(QualType Ty, bool ByVal, CCState &State) const;
542 unsigned getTypeStackAlignInBytes(QualType Ty, unsigned Align) const;
544 Class classify(QualType Ty) const;
547 bool shouldUseInReg(QualType Ty, CCState &State, bool &NeedsPadding) const;
560 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
592 llvm::Type* Ty) const override {
593 return X86AdjustInlineAsmType(CGF, Constraint, Ty);
611 bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty,
613 uint64_t Size = Context.getTypeSize(Ty);
619 if (Ty->isVectorType()) {
630 if (Ty->getAs<BuiltinType>() || Ty->hasPointerRepresentation() ||
631 Ty->isAnyComplexType() || Ty->isEnumeralType() ||
632 Ty->isBlockPointerType() || Ty->isMemberPointerType())
636 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty))
640 const RecordType *RT = Ty->getAs<RecordType>();
740 static bool isSSEVectorType(ASTContext &Context, QualType Ty) {
741 return Ty->getAs<VectorType>() && Context.getTypeSize(Ty) == 128;
744 static bool isRecordWithSSEVectorType(ASTContext &Context, QualType Ty) {
745 const RecordType *RT = Ty->getAs<RecordType>();
769 unsigned X86_32ABIInfo::getTypeStackAlignInBytes(QualType Ty,
783 if (Align >= 16 && (isSSEVectorType(getContext(), Ty) ||
784 isRecordWithSSEVectorType(getContext(), Ty)))
790 ABIArgInfo X86_32ABIInfo::getIndirectResult(QualType Ty, bool ByVal,
801 unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8;
802 unsigned StackAlign = getTypeStackAlignInBytes(Ty, TypeAlign);
812 X86_32ABIInfo::Class X86_32ABIInfo::classify(QualType Ty) const {
813 const Type *T = isSingleElementStruct(Ty, getContext());
815 T = Ty.getTypePtr();
825 bool X86_32ABIInfo::shouldUseInReg(QualType Ty, CCState &State,
828 Class C = classify(Ty);
832 unsigned Size = getContext().getTypeSize(Ty);
849 if (Ty->isIntegralOrEnumerationType())
852 if (Ty->isPointerType())
855 if (Ty->isReferenceType())
867 ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty,
870 if (isAggregateTypeForABI(Ty)) {
871 if (const RecordType *RT = Ty->getAs<RecordType>()) {
875 return getIndirectResult(Ty, false, State);
883 return getIndirectResult(Ty, true, State);
887 return getIndirectResult(Ty, true, State);
891 if (isEmptyRecord(getContext(), Ty, true))
897 if (shouldUseInReg(Ty, State, NeedsPadding)) {
898 unsigned SizeInRegs = (getContext().getTypeSize(Ty) + 31) / 32;
909 if (getContext().getTypeSize(Ty) <= 4*32 &&
910 canExpandIndirectArgument(Ty, getContext()))
914 return getIndirectResult(Ty, true, State);
917 if (const VectorType *VT = Ty->getAs<VectorType>()) {
921 uint64_t Size = getContext().getTypeSize(Ty);
928 if (IsX86_MMXType(CGT.ConvertType(Ty)))
935 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
936 Ty = EnumTy->getDecl()->getIntegerType();
939 bool InReg = shouldUseInReg(Ty, State, NeedsPadding);
941 if (Ty->isPromotableIntegerType()) {
999 llvm::Type *Ty = llvm::Type::getInt8Ty(getVMContext());
1000 Ty = llvm::ArrayType::get(Ty, NumBytes);
1001 FrameFields.push_back(Ty);
1053 llvm::Value *X86_32ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
1063 unsigned Align = CGF.getContext().getTypeAlignInChars(Ty).getQuantity();
1064 Align = getTypeStackAlignInBytes(Ty, Align);
1080 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
1084 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, Align);
1257 llvm::Type *GetByteVectorType(QualType Ty) const;
1265 /// getIndirectResult - Give a source type \arg Ty, return a suitable result
1267 ABIArgInfo getIndirectReturnResult(QualType Ty) const;
1269 /// getIndirectResult - Give a source type \arg Ty, return a suitable result
1274 ABIArgInfo getIndirectResult(QualType Ty, unsigned freeIntRegs) const;
1278 ABIArgInfo classifyArgumentType(QualType Ty,
1284 bool IsIllegalVectorType(QualType Ty) const;
1321 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
1328 ABIArgInfo classify(QualType Ty, bool IsReturnType) const;
1335 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
1364 llvm::Type* Ty) const override {
1365 return X86AdjustInlineAsmType(CGF, Constraint, Ty);
1380 if (getABIInfo().isPassedUsingAVXType(it->Ty)) {
1539 void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase,
1554 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
1577 if (const EnumType *ET = Ty->getAs<EnumType>()) {
1583 if (Ty->hasPointerRepresentation()) {
1588 if (Ty->isMemberPointerType()) {
1589 if (Ty->isMemberFunctionPointerType() && Has64BitPointers)
1596 if (const VectorType *VT = Ty->getAs<VectorType>()) {
1645 if (const ComplexType *CT = Ty->getAs<ComplexType>()) {
1648 uint64_t Size = getContext().getTypeSize(Ty);
1673 if (const ConstantArrayType *AT = getContext().getAsConstantArrayType(Ty)) {
1676 uint64_t Size = getContext().getTypeSize(Ty);
1716 if (const RecordType *RT = Ty->getAs<RecordType>()) {
1717 uint64_t Size = getContext().getTypeSize(Ty);
1831 ABIArgInfo X86_64ABIInfo::getIndirectReturnResult(QualType Ty) const {
1834 if (!isAggregateTypeForABI(Ty)) {
1836 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
1837 Ty = EnumTy->getDecl()->getIntegerType();
1839 return (Ty->isPromotableIntegerType() ?
1846 bool X86_64ABIInfo::IsIllegalVectorType(QualType Ty) const {
1847 if (const VectorType *VecTy = Ty->getAs<VectorType>()) {
1857 ABIArgInfo X86_64ABIInfo::getIndirectResult(QualType Ty,
1867 if (!isAggregateTypeForABI(Ty) && !IsIllegalVectorType(Ty)) {
1869 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
1870 Ty = EnumTy->getDecl()->getIntegerType();
1872 return (Ty->isPromotableIntegerType() ?
1876 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
1881 unsigned Align = std::max(getContext().getTypeAlign(Ty) / 8, 8U);
1905 uint64_t Size = getContext().getTypeSize(Ty);
1920 llvm::Type *X86_64ABIInfo::GetByteVectorType(QualType Ty) const {
1921 llvm::Type *IRType = CGT.ConvertType(Ty);
1953 static bool BitsContainNoUserData(QualType Ty, unsigned StartBit,
1958 unsigned TySize = (unsigned)Context.getTypeSize(Ty);
1962 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) {
1981 if (const RecordType *RT = Ty->getAs<RecordType>()) {
2332 QualType Ty, unsigned freeIntRegs, unsigned &neededInt, unsigned &neededSSE,
2337 classify(Ty, 0, Lo, Hi, isNamedArg);
2365 if (getRecordArgABI(Ty, getCXXABI()) == CGCXXABI::RAA_Indirect)
2367 return getIndirectResult(Ty, freeIntRegs);
2380 ResType = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 0, Ty, 0);
2386 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
2387 Ty = EnumTy->getDecl()->getIntegerType();
2389 if (Ty->isIntegralOrEnumerationType() &&
2390 Ty->isPromotableIntegerType())
2400 llvm::Type *IRType = CGT.ConvertType(Ty);
2401 ResType = GetSSETypeAtOffset(IRType, 0, Ty, 0);
2422 HighPart = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8);
2432 HighPart = GetSSETypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8);
2445 ResType = GetByteVectorType(Ty);
2503 QualType Ty,
2514 uint64_t Align = CGF.getContext().getTypeAlign(Ty) / 8;
2530 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty);
2540 uint64_t SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8;
2551 llvm::Value *X86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2562 Ty = CGF.getContext().getCanonicalType(Ty);
2563 ABIArgInfo AI = classifyArgumentType(Ty, 0, neededInt, neededSSE,
2569 return EmitVAArgFromMemory(VAListAddr, Ty, CGF);
2620 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty);
2628 llvm::Value *Tmp = CGF.CreateMemTemp(Ty);
2656 CGF.getContext().getTypeInfoInChars(Ty);
2660 llvm::Value *Tmp = CGF.CreateMemTemp(Ty);
2678 llvm::Value *V, *Tmp = CGF.CreateMemTemp(Ty);
2708 llvm::Value *MemAddr = EmitVAArgFromMemory(VAListAddr, Ty, CGF);
2720 ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, bool IsReturnType) const {
2722 if (Ty->isVoidType())
2725 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
2726 Ty = EnumTy->getDecl()->getIntegerType();
2728 uint64_t Size = getContext().getTypeSize(Ty);
2730 const RecordType *RT = Ty->getAs<RecordType>();
2746 if (Ty->isMemberPointerType()) {
2749 llvm::Type *LLTy = CGT.ConvertType(Ty);
2754 if (RT || Ty->isMemberPointerType()) {
2764 if (Ty->isPromotableIntegerType())
2778 llvm::Value *WinX86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2787 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
2791 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, 8);
2807 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2829 llvm::Value *NaClX86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2833 return NInfo.EmitVAArg(VAListAddr, Ty, CGF);
2905 bool isPromotableTypeForABI(QualType Ty) const;
2906 bool isAlignedParamType(QualType Ty) const;
2909 ABIArgInfo classifyArgumentType(QualType Ty) const;
2938 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2971 // Return true if the ABI requires Ty to be passed sign- or zero-
2974 PPC64_SVR4_ABIInfo::isPromotableTypeForABI(QualType Ty) const {
2976 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
2977 Ty = EnumTy->getDecl()->getIntegerType();
2980 if (Ty->isPromotableIntegerType())
2985 if (const BuiltinType *BT = Ty->getAs<BuiltinType>())
3000 PPC64_SVR4_ABIInfo::isAlignedParamType(QualType Ty) const {
3002 if (const ComplexType *CTy = Ty->getAs<ComplexType>())
3003 Ty = CTy->getElementType();
3007 if (Ty->isVectorType())
3008 return getContext().getTypeSize(Ty) == 128;
3013 const Type *EltType = isSingleElementStruct(Ty, getContext());
3028 if (isAggregateTypeForABI(Ty) && getContext().getTypeAlign(Ty) >= 128)
3035 PPC64_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const {
3036 if (Ty->isAnyComplexType())
3041 if (Ty->isVectorType()) {
3042 uint64_t Size = getContext().getTypeSize(Ty);
3051 if (isAggregateTypeForABI(Ty)) {
3052 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
3055 uint64_t ABIAlign = isAlignedParamType(Ty)? 16 : 8;
3056 uint64_t TyAlign = getContext().getTypeAlign(Ty) / 8;
3061 return (isPromotableTypeForABI(Ty) ?
3094 QualType Ty,
3104 if (isAlignedParamType(Ty)) {
3115 unsigned SizeInBytes = CGF.getContext().getTypeSize(Ty) / 8;
3119 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) {
3152 llvm::Value *Ptr = CGF.CreateTempAlloca(CGT.ConvertTypeForMem(Ty),
3170 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
3257 bool isIllegalVectorType(QualType Ty) const;
3326 llvm::Value *EmitDarwinVAArg(llvm::Value *VAListAddr, QualType Ty,
3329 llvm::Value *EmitAAPCSVAArg(llvm::Value *VAListAddr, QualType Ty,
3332 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3334 return isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF)
3335 : EmitAAPCSVAArg(VAListAddr, Ty, CGF);
3354 static bool isHomogeneousAggregate(QualType Ty, const Type *&Base,
3358 ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty,
3365 if (isIllegalVectorType(Ty)) {
3366 uint64_t Size = getContext().getTypeSize(Ty);
3393 if (Ty->isVectorType())
3396 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
3404 if (!isAggregateTypeForABI(Ty)) {
3406 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
3407 Ty = EnumTy->getDecl()->getIntegerType();
3409 if (!Ty->isFloatingType() && !Ty->isVectorType()) {
3410 unsigned Alignment = getContext().getTypeAlign(Ty);
3414 int RegsNeeded = getContext().getTypeSize(Ty) > 64 ? 2 : 1;
3417 return (Ty->isPromotableIntegerType() && isDarwinPCS()
3424 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) {
3432 if (isEmptyRecord(getContext(), Ty, true)) {
3443 if (isHomogeneousAggregate(Ty, Base, getContext(), &Members)) {
3448 uint64_t Size = getContext().getTypeSize(Ty);
3457 uint64_t Size = getContext().getTypeSize(Ty);
3459 unsigned Alignment = getContext().getTypeAlign(Ty);
3516 bool AArch64ABIInfo::isIllegalVectorType(QualType Ty) const {
3517 if (const VectorType *VT = Ty->getAs<VectorType>()) {
3529 static llvm::Value *EmitAArch64VAArg(llvm::Value *VAListAddr, QualType Ty,
3589 if (AllocatedGPR && !IsIndirect && Ctx.getTypeAlign(Ty) > 64) {
3590 int Align = Ctx.getTypeAlign(Ty) / 8;
3628 llvm::Type *MemTy = llvm::PointerType::getUnqual(CGF.ConvertTypeForMem(Ty));
3638 bool IsHFA = isHomogeneousAggregate(Ty, Base, Ctx, &NumMembers);
3669 (IsHFA || !isAggregateTypeForABI(Ty)) &&
3670 Ctx.getTypeSize(Ty) < (BeAlign * 8)) {
3671 int Offset = BeAlign - Ctx.getTypeSize(Ty) / 8;
3696 if (!IsIndirect && Ctx.getTypeAlign(Ty) > 64) {
3697 int Align = Ctx.getTypeAlign(Ty) / 8;
3715 StackSize = Ctx.getTypeSize(Ty) / 8;
3727 if (CGF.CGM.getDataLayout().isBigEndian() && !isAggregateTypeForABI(Ty) &&
3728 Ctx.getTypeSize(Ty) < 64) {
3729 int Offset = 8 - Ctx.getTypeSize(Ty) / 8;
3757 llvm::Value *AArch64ABIInfo::EmitAAPCSVAArg(llvm::Value *VAListAddr, QualType Ty,
3762 ABIArgInfo AI = classifyArgumentType(Ty, AllocatedVFP, IsHA, AllocatedGPR,
3765 return EmitAArch64VAArg(VAListAddr, Ty, AllocatedGPR, AllocatedVFP,
3769 llvm::Value *AArch64ABIInfo::EmitDarwinVAArg(llvm::Value *VAListAddr, QualType Ty,
3774 if (!isAggregateTypeForABI(Ty) && !isIllegalVectorType(Ty))
3777 uint64_t Size = CGF.getContext().getTypeSize(Ty) / 8;
3778 uint64_t Align = CGF.getContext().getTypeAlign(Ty) / 8;
3781 bool isHA = isHomogeneousAggregate(Ty, Base, getContext());
3799 if (isEmptyRecord(getContext(), Ty, true)) {
3801 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
3822 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
3886 bool isIllegalVectorType(QualType Ty) const;
3890 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4064 static bool isHomogeneousAggregate(QualType Ty, const Type *&Base,
4067 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) {
4071 } else if (const RecordType *RT = Ty->getAs<RecordType>()) {
4087 if (const ComplexType *CT = Ty->getAs<ComplexType>()) {
4089 Ty = CT->getElementType();
4094 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
4099 } else if (const VectorType *VT = Ty->getAs<VectorType>()) {
4109 const Type *TyPtr = Ty.getTypePtr();
4199 ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic,
4211 if (isIllegalVectorType(Ty)) {
4212 uint64_t Size = getContext().getTypeSize(Ty);
4246 if (const VectorType *VT = Ty->getAs<VectorType>()) {
4255 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
4269 if (!isAggregateTypeForABI(Ty)) {
4271 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) {
4272 Ty = EnumTy->getDecl()->getIntegerType();
4275 unsigned Size = getContext().getTypeSize(Ty);
4278 return (Ty->isPromotableIntegerType() ?
4282 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) {
4288 if (isEmptyRecord(getContext(), Ty, true))
4296 if (isHomogeneousAggregate(Ty, Base, getContext(), &Members)) {
4321 uint64_t TyAlign = getContext().getTypeAlign(Ty) / 8;
4325 if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64)) {
4340 if (getContext().getTypeAlign(Ty) <= 32) {
4342 SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32;
4346 SizeRegs = (getContext().getTypeSize(Ty) + 63) / 64;
4355 static bool isIntegerLikeType(QualType Ty, ASTContext &Context,
4361 uint64_t Size = Context.getTypeSize(Ty);
4368 if (Ty->isVectorType())
4372 if (Ty->isRealFloatingType())
4376 if (Ty->getAs<BuiltinType>() || Ty->isPointerType())
4380 if (const ComplexType *CT = Ty->getAs<ComplexType>())
4387 const RecordType *RT = Ty->getAs<RecordType>();
4524 /// isIllegalVector - check whether Ty is an illegal vector type.
4525 bool ARMABIInfo::isIllegalVectorType(QualType Ty) const {
4526 if (const VectorType *VT = Ty->getAs<VectorType>()) {
4536 llvm::Value *ARMABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4545 if (isEmptyRecord(getContext(), Ty, true)) {
4547 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
4551 uint64_t Size = CGF.getContext().getTypeSize(Ty) / 8;
4552 uint64_t TyAlign = CGF.getContext().getTypeAlign(Ty) / 8;
4563 if (isIllegalVectorType(Ty) && Size > 32) {
4588 else if (TyAlign < CGF.getContext().getTypeAlign(Ty) / 8) {
4595 CharUnits CharSize = getContext().getTypeSizeInChars(Ty);
4596 llvm::Value *AlignedTemp = CGF.CreateTempAlloca(CGF.ConvertType(Ty),
4606 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
4619 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4641 llvm::Value *NaClARMABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4645 return static_cast<const ABIInfo&>(NInfo).EmitVAArg(VAListAddr, Ty, CGF);
4659 ABIArgInfo classifyArgumentType(QualType Ty) const;
4662 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4695 ABIArgInfo NVPTXABIInfo::classifyArgumentType(QualType Ty) const {
4697 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
4698 Ty = EnumTy->getDecl()->getIntegerType();
4700 return (Ty->isPromotableIntegerType() ?
4717 llvm::Value *NVPTXABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4795 bool isPromotableIntegerType(QualType Ty) const;
4796 bool isCompoundType(QualType Ty) const;
4797 bool isFPArgumentType(QualType Ty) const;
4809 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4821 bool SystemZABIInfo::isPromotableIntegerType(QualType Ty) const {
4823 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
4824 Ty = EnumTy->getDecl()->getIntegerType();
4827 if (Ty->isPromotableIntegerType())
4831 if (const BuiltinType *BT = Ty->getAs<BuiltinType>())
4842 bool SystemZABIInfo::isCompoundType(QualType Ty) const {
4843 return Ty->isAnyComplexType() || isAggregateTypeForABI(Ty);
4846 bool SystemZABIInfo::isFPArgumentType(QualType Ty) const {
4847 if (const BuiltinType *BT = Ty->getAs<BuiltinType>())
4856 if (const RecordType *RT = Ty->getAsStructureType()) {
4901 llvm::Value *SystemZABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4913 Ty = CGF.getContext().getCanonicalType(Ty);
4914 ABIArgInfo AI = classifyArgumentType(Ty);
4915 bool InFPRs = isFPArgumentType(Ty);
4917 llvm::Type *APTy = llvm::PointerType::getUnqual(CGF.ConvertTypeForMem(Ty));
4924 UnpaddedBitSize = getContext().getTypeSize(Ty);
5025 ABIArgInfo SystemZABIInfo::classifyArgumentType(QualType Ty) const {
5027 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
5031 if (isPromotableIntegerType(Ty))
5035 uint64_t Size = getContext().getTypeSize(Ty);
5040 if (const RecordType *RT = Ty->getAs<RecordType>()) {
5049 if (isFPArgumentType(Ty)) {
5061 if (isCompoundType(Ty))
5116 llvm::Type* HandleAggregates(QualType Ty, uint64_t TySize) const;
5127 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5182 llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty, uint64_t TySize) const {
5190 if (Ty->isComplexType())
5191 return CGT.ConvertType(Ty);
5193 const RecordType *RT = Ty->getAs<RecordType>();
5213 const QualType Ty = i->getType();
5214 const BuiltinType *BT = Ty->getAs<BuiltinType>();
5247 MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const {
5249 uint64_t TySize = getContext().getTypeSize(Ty);
5250 uint64_t Align = getContext().getTypeAlign(Ty) / 8;
5257 if (isAggregateTypeForABI(Ty) || Ty->isVectorType()) {
5262 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) {
5270 return ABIArgInfo::getDirect(HandleAggregates(Ty, TySize), 0,
5275 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
5276 Ty = EnumTy->getDecl()->getIntegerType();
5278 if (Ty->isPromotableIntegerType())
5369 llvm::Value* MipsABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5377 int64_t TypeAlign = getContext().getTypeAlign(Ty) / 8;
5378 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
5397 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, TypeAlign);
5511 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5534 ABIArgInfo HexagonABIInfo::classifyArgumentType(QualType Ty) const {
5535 if (!isAggregateTypeForABI(Ty)) {
5537 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
5538 Ty = EnumTy->getDecl()->getIntegerType();
5540 return (Ty->isPromotableIntegerType() ?
5545 if (isEmptyRecord(getContext(), Ty, true))
5548 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
5551 uint64_t Size = getContext().getTypeSize(Ty);
5602 llvm::Value *HexagonABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5612 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
5616 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, 4);
5660 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5711 void addFloat(uint64_t Offset, llvm::Type *Ty, unsigned Bits) {
5719 Elems.push_back(Ty);
5755 // Check if Ty is a usable substitute for the coercion type.
5756 bool isUsableType(llvm::StructType *Ty) const {
5757 if (Ty->getNumElements() != Elems.size())
5760 if (Elems[i] != Ty->getElementType(i))
5777 SparcV9ABIInfo::classifyType(QualType Ty, unsigned SizeLimit) const {
5778 if (Ty->isVoidType())
5781 uint64_t Size = getContext().getTypeSize(Ty);
5789 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
5790 Ty = EnumTy->getDecl()->getIntegerType();
5793 if (Size < 64 && Ty->isIntegerType())
5797 if (!isAggregateTypeForABI(Ty))
5802 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI()))
5807 llvm::StructType *StrTy = dyn_cast<llvm::StructType>(CGT.ConvertType(Ty));
5824 llvm::Value *SparcV9ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5826 ABIArgInfo AI = classifyType(Ty, 16 * 8);
5827 llvm::Type *ArgTy = CGT.ConvertType(Ty);
6032 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
6047 llvm::Value *XCoreABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
6057 ABIArgInfo AI = classifyArgumentType(Ty);
6058 llvm::Type *ArgTy = CGT.ConvertType(Ty);