Lines Matching refs:Ty
71 static QualType useFirstFieldIfTransparentUnion(QualType Ty) { in useFirstFieldIfTransparentUnion() argument
72 if (const RecordType *UT = Ty->getAsUnionType()) { in useFirstFieldIfTransparentUnion()
79 return Ty; in useFirstFieldIfTransparentUnion()
102 bool ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
117 if (llvm::Type *Ty = getCoerceToType()) in dump() local
118 Ty->print(OS); in dump()
308 static bool is32Or64BitBasicType(QualType Ty, ASTContext &Context) { in is32Or64BitBasicType() argument
310 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) in is32Or64BitBasicType()
311 Ty = CTy->getElementType(); in is32Or64BitBasicType()
316 if (!Ty->getAs<BuiltinType>() && !Ty->hasPointerRepresentation() && in is32Or64BitBasicType()
317 !Ty->isEnumeralType() && !Ty->isBlockPointerType()) in is32Or64BitBasicType()
320 uint64_t Size = Context.getTypeSize(Ty); in is32Or64BitBasicType()
333 static bool canExpandIndirectArgument(QualType Ty, ASTContext &Context) { in canExpandIndirectArgument() argument
335 const RecordType *RT = Ty->getAs<RecordType>(); in canExpandIndirectArgument()
368 if (Size != Context.getTypeSize(Ty)) in canExpandIndirectArgument()
393 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
403 llvm::Value *DefaultABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
408 ABIArgInfo DefaultABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
409 if (isAggregateTypeForABI(Ty)) in classifyArgumentType()
413 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
414 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
416 return (Ty->isPromotableIntegerType() ? in classifyArgumentType()
450 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
468 llvm::Value *PNaClABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
474 ABIArgInfo PNaClABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
475 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
476 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
479 } else if (const EnumType *EnumTy = Ty->getAs<EnumType>()) { in classifyArgumentType()
481 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
482 } else if (Ty->isFloatingType()) { in classifyArgumentType()
487 return (Ty->isPromotableIntegerType() ? in classifyArgumentType()
517 llvm::Type* Ty) { in X86AdjustInlineAsmType() argument
518 if ((Constraint == "y" || Constraint == "&y") && Ty->isVectorTy()) { in X86AdjustInlineAsmType()
519 if (cast<llvm::VectorType>(Ty)->getBitWidth() != 64) { in X86AdjustInlineAsmType()
528 return Ty; in X86AdjustInlineAsmType()
533 static bool isX86VectorTypeForVectorCall(ASTContext &Context, QualType Ty) { in isX86VectorTypeForVectorCall() argument
534 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isX86VectorTypeForVectorCall()
537 } else if (const VectorType *VT = Ty->getAs<VectorType>()) { in isX86VectorTypeForVectorCall()
584 bool isHomogeneousAggregateBaseType(QualType Ty) const override { in isHomogeneousAggregateBaseType()
586 return isX86VectorTypeForVectorCall(getContext(), Ty); in isHomogeneousAggregateBaseType()
589 bool isHomogeneousAggregateSmallEnough(const Type *Ty, in isHomogeneousAggregateSmallEnough() argument
595 bool shouldReturnTypeInRegister(QualType Ty, ASTContext &Context) const;
599 ABIArgInfo getIndirectResult(QualType Ty, bool ByVal, CCState &State) const;
604 unsigned getTypeStackAlignInBytes(QualType Ty, unsigned Align) const;
606 Class classify(QualType Ty) const;
609 bool shouldUseInReg(QualType Ty, CCState &State, bool &NeedsPadding) const;
622 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
654 llvm::Type* Ty) const override { in adjustInlineAsmType()
655 return X86AdjustInlineAsmType(CGF, Constraint, Ty); in adjustInlineAsmType()
759 bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty, in shouldReturnTypeInRegister() argument
761 uint64_t Size = Context.getTypeSize(Ty); in shouldReturnTypeInRegister()
767 if (Ty->isVectorType()) { in shouldReturnTypeInRegister()
778 if (Ty->getAs<BuiltinType>() || Ty->hasPointerRepresentation() || in shouldReturnTypeInRegister()
779 Ty->isAnyComplexType() || Ty->isEnumeralType() || in shouldReturnTypeInRegister()
780 Ty->isBlockPointerType() || Ty->isMemberPointerType()) in shouldReturnTypeInRegister()
784 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) in shouldReturnTypeInRegister()
788 const RecordType *RT = Ty->getAs<RecordType>(); in shouldReturnTypeInRegister()
896 static bool isSSEVectorType(ASTContext &Context, QualType Ty) { in isSSEVectorType() argument
897 return Ty->getAs<VectorType>() && Context.getTypeSize(Ty) == 128; in isSSEVectorType()
900 static bool isRecordWithSSEVectorType(ASTContext &Context, QualType Ty) { in isRecordWithSSEVectorType() argument
901 const RecordType *RT = Ty->getAs<RecordType>(); in isRecordWithSSEVectorType()
925 unsigned X86_32ABIInfo::getTypeStackAlignInBytes(QualType Ty, in getTypeStackAlignInBytes() argument
939 if (Align >= 16 && (isSSEVectorType(getContext(), Ty) || in getTypeStackAlignInBytes()
940 isRecordWithSSEVectorType(getContext(), Ty))) in getTypeStackAlignInBytes()
946 ABIArgInfo X86_32ABIInfo::getIndirectResult(QualType Ty, bool ByVal, in getIndirectResult() argument
957 unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8; in getIndirectResult()
958 unsigned StackAlign = getTypeStackAlignInBytes(Ty, TypeAlign); in getIndirectResult()
968 X86_32ABIInfo::Class X86_32ABIInfo::classify(QualType Ty) const { in classify()
969 const Type *T = isSingleElementStruct(Ty, getContext()); in classify()
971 T = Ty.getTypePtr(); in classify()
981 bool X86_32ABIInfo::shouldUseInReg(QualType Ty, CCState &State, in shouldUseInReg() argument
984 Class C = classify(Ty); in shouldUseInReg()
988 unsigned Size = getContext().getTypeSize(Ty); in shouldUseInReg()
1006 if (Ty->isIntegralOrEnumerationType()) in shouldUseInReg()
1009 if (Ty->isPointerType()) in shouldUseInReg()
1012 if (Ty->isReferenceType()) in shouldUseInReg()
1024 ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty, in classifyArgumentType() argument
1028 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
1031 const RecordType *RT = Ty->getAs<RecordType>(); in classifyArgumentType()
1035 return getIndirectResult(Ty, false, State); in classifyArgumentType()
1047 isHomogeneousAggregate(Ty, Base, NumElts)) { in classifyArgumentType()
1050 if (Ty->isBuiltinType() || Ty->isVectorType()) in classifyArgumentType()
1054 return getIndirectResult(Ty, /*ByVal=*/false, State); in classifyArgumentType()
1057 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
1061 return getIndirectResult(Ty, true, State); in classifyArgumentType()
1065 return getIndirectResult(Ty, true, State); in classifyArgumentType()
1069 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
1075 if (shouldUseInReg(Ty, State, NeedsPadding)) { in classifyArgumentType()
1076 unsigned SizeInRegs = (getContext().getTypeSize(Ty) + 31) / 32; in classifyArgumentType()
1087 if (getContext().getTypeSize(Ty) <= 4*32 && in classifyArgumentType()
1088 canExpandIndirectArgument(Ty, getContext())) in classifyArgumentType()
1094 return getIndirectResult(Ty, true, State); in classifyArgumentType()
1097 if (const VectorType *VT = Ty->getAs<VectorType>()) { in classifyArgumentType()
1101 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
1108 if (IsX86_MMXType(CGT.ConvertType(Ty))) in classifyArgumentType()
1115 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
1116 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
1119 bool InReg = shouldUseInReg(Ty, State, NeedsPadding); in classifyArgumentType()
1121 if (Ty->isPromotableIntegerType()) { in classifyArgumentType()
1186 llvm::Type *Ty = llvm::Type::getInt8Ty(getVMContext()); in addFieldToArgStruct() local
1187 Ty = llvm::ArrayType::get(Ty, NumBytes); in addFieldToArgStruct()
1188 FrameFields.push_back(Ty); in addFieldToArgStruct()
1253 llvm::Value *X86_32ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
1263 unsigned Align = CGF.getContext().getTypeAlignInChars(Ty).getQuantity(); in EmitVAArg()
1264 Align = getTypeStackAlignInBytes(Ty, Align); in EmitVAArg()
1280 llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
1284 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, Align); in EmitVAArg()
1448 llvm::Type *GetByteVectorType(QualType Ty) const;
1458 ABIArgInfo getIndirectReturnResult(QualType Ty) const;
1465 ABIArgInfo getIndirectResult(QualType Ty, unsigned freeIntRegs) const;
1469 ABIArgInfo classifyArgumentType(QualType Ty,
1475 bool IsIllegalVectorType(QualType Ty) const;
1512 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
1523 ABIArgInfo classify(QualType Ty, unsigned &FreeSSERegs,
1531 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
1534 bool isHomogeneousAggregateBaseType(QualType Ty) const override { in isHomogeneousAggregateBaseType()
1536 return isX86VectorTypeForVectorCall(getContext(), Ty); in isHomogeneousAggregateBaseType()
1539 bool isHomogeneousAggregateSmallEnough(const Type *Ty, in isHomogeneousAggregateSmallEnough() argument
1572 llvm::Type* Ty) const override { in adjustInlineAsmType()
1573 return X86AdjustInlineAsmType(CGF, Constraint, Ty); in adjustInlineAsmType()
1588 if (getABIInfo().isPassedUsingAVXType(it->Ty)) { in isNoProtoCallVariadic()
1811 void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase, in classify() argument
1826 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in classify()
1849 if (const EnumType *ET = Ty->getAs<EnumType>()) { in classify()
1855 if (Ty->hasPointerRepresentation()) { in classify()
1860 if (Ty->isMemberPointerType()) { in classify()
1861 if (Ty->isMemberFunctionPointerType()) { in classify()
1883 if (const VectorType *VT = Ty->getAs<VectorType>()) { in classify()
1932 if (const ComplexType *CT = Ty->getAs<ComplexType>()) { in classify()
1935 uint64_t Size = getContext().getTypeSize(Ty); in classify()
1960 if (const ConstantArrayType *AT = getContext().getAsConstantArrayType(Ty)) { in classify()
1963 uint64_t Size = getContext().getTypeSize(Ty); in classify()
2003 if (const RecordType *RT = Ty->getAs<RecordType>()) { in classify()
2004 uint64_t Size = getContext().getTypeSize(Ty); in classify()
2118 ABIArgInfo X86_64ABIInfo::getIndirectReturnResult(QualType Ty) const { in getIndirectReturnResult()
2121 if (!isAggregateTypeForABI(Ty)) { in getIndirectReturnResult()
2123 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in getIndirectReturnResult()
2124 Ty = EnumTy->getDecl()->getIntegerType(); in getIndirectReturnResult()
2126 return (Ty->isPromotableIntegerType() ? in getIndirectReturnResult()
2133 bool X86_64ABIInfo::IsIllegalVectorType(QualType Ty) const { in IsIllegalVectorType()
2134 if (const VectorType *VecTy = Ty->getAs<VectorType>()) { in IsIllegalVectorType()
2144 ABIArgInfo X86_64ABIInfo::getIndirectResult(QualType Ty, in getIndirectResult() argument
2154 if (!isAggregateTypeForABI(Ty) && !IsIllegalVectorType(Ty)) { in getIndirectResult()
2156 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in getIndirectResult()
2157 Ty = EnumTy->getDecl()->getIntegerType(); in getIndirectResult()
2159 return (Ty->isPromotableIntegerType() ? in getIndirectResult()
2163 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in getIndirectResult()
2168 unsigned Align = std::max(getContext().getTypeAlign(Ty) / 8, 8U); in getIndirectResult()
2192 uint64_t Size = getContext().getTypeSize(Ty); in getIndirectResult()
2206 llvm::Type *X86_64ABIInfo::GetByteVectorType(QualType Ty) const { in GetByteVectorType()
2209 if (const Type *InnerTy = isSingleElementStruct(Ty, getContext())) in GetByteVectorType()
2210 Ty = QualType(InnerTy, 0); in GetByteVectorType()
2212 llvm::Type *IRType = CGT.ConvertType(Ty); in GetByteVectorType()
2225 static bool BitsContainNoUserData(QualType Ty, unsigned StartBit, in BitsContainNoUserData() argument
2230 unsigned TySize = (unsigned)Context.getTypeSize(Ty); in BitsContainNoUserData()
2234 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) { in BitsContainNoUserData()
2253 if (const RecordType *RT = Ty->getAs<RecordType>()) { in BitsContainNoUserData()
2604 QualType Ty, unsigned freeIntRegs, unsigned &neededInt, unsigned &neededSSE, in classifyArgumentType() argument
2608 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
2611 classify(Ty, 0, Lo, Hi, isNamedArg); in classifyArgumentType()
2639 if (getRecordArgABI(Ty, getCXXABI()) == CGCXXABI::RAA_Indirect) in classifyArgumentType()
2641 return getIndirectResult(Ty, freeIntRegs); in classifyArgumentType()
2654 ResType = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 0, Ty, 0); in classifyArgumentType()
2660 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
2661 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
2663 if (Ty->isIntegralOrEnumerationType() && in classifyArgumentType()
2664 Ty->isPromotableIntegerType()) in classifyArgumentType()
2674 llvm::Type *IRType = CGT.ConvertType(Ty); in classifyArgumentType()
2675 ResType = GetSSETypeAtOffset(IRType, 0, Ty, 0); in classifyArgumentType()
2696 HighPart = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8); in classifyArgumentType()
2706 HighPart = GetSSETypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8); in classifyArgumentType()
2719 ResType = GetByteVectorType(Ty); in classifyArgumentType()
2775 QualType Ty, in EmitVAArgFromMemory() argument
2786 uint64_t Align = CGF.getContext().getTypeAlign(Ty) / 8; in EmitVAArgFromMemory()
2802 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty); in EmitVAArgFromMemory()
2812 uint64_t SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8; in EmitVAArgFromMemory()
2823 llvm::Value *X86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
2834 Ty = CGF.getContext().getCanonicalType(Ty); in EmitVAArg()
2835 ABIArgInfo AI = classifyArgumentType(Ty, 0, neededInt, neededSSE, in EmitVAArg()
2841 return EmitVAArgFromMemory(VAListAddr, Ty, CGF); in EmitVAArg()
2894 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty); in EmitVAArg()
2901 llvm::Value *Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
2929 CGF.getContext().getTypeInfoInChars(Ty); in EmitVAArg()
2933 llvm::Value *Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
2951 llvm::Value *V, *Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
2981 llvm::Value *MemAddr = EmitVAArgFromMemory(VAListAddr, Ty, CGF); in EmitVAArg()
2993 ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs, in classify() argument
2996 if (Ty->isVoidType()) in classify()
2999 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classify()
3000 Ty = EnumTy->getDecl()->getIntegerType(); in classify()
3002 TypeInfo Info = getContext().getTypeInfo(Ty); in classify()
3006 const RecordType *RT = Ty->getAs<RecordType>(); in classify()
3026 if (FreeSSERegs && isHomogeneousAggregate(Ty, Base, NumElts)) { in classify()
3029 if (IsReturnType || Ty->isBuiltinType() || Ty->isVectorType()) in classify()
3037 if (Ty->isMemberPointerType()) { in classify()
3040 llvm::Type *LLTy = CGT.ConvertType(Ty); in classify()
3045 if (RT || Ty->isAnyComplexType() || Ty->isMemberPointerType()) { in classify()
3057 const BuiltinType *BT = Ty->getAs<BuiltinType>(); in classify()
3079 llvm::Value *WinX86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
3088 llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
3092 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, 8); in EmitVAArg()
3108 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3132 QualType Ty, in EmitVAArg() argument
3134 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) { in EmitVAArg()
3140 bool isI64 = Ty->isIntegerType() && getContext().getTypeSize(Ty) == 64; in EmitVAArg()
3141 bool isInt = Ty->isIntegerType() || Ty->isPointerType() || Ty->isAggregateType(); in EmitVAArg()
3176 if (Ty->isFloatingType()) in EmitVAArg()
3187 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
3213 if (Ty->isAggregateType()) { in EmitVAArg()
3280 bool IsQPXVectorTy(const Type *Ty) const { in IsQPXVectorTy()
3284 if (const VectorType *VT = Ty->getAs<VectorType>()) { in IsQPXVectorTy()
3290 if (getContext().getTypeSize(Ty) <= 256) in IsQPXVectorTy()
3294 if (getContext().getTypeSize(Ty) <= 128) in IsQPXVectorTy()
3302 bool IsQPXVectorTy(QualType Ty) const { in IsQPXVectorTy()
3303 return IsQPXVectorTy(Ty.getTypePtr()); in IsQPXVectorTy()
3310 bool isPromotableTypeForABI(QualType Ty) const;
3311 bool isAlignedParamType(QualType Ty, bool &Align32) const;
3314 ABIArgInfo classifyArgumentType(QualType Ty) const;
3316 bool isHomogeneousAggregateBaseType(QualType Ty) const override;
3317 bool isHomogeneousAggregateSmallEnough(const Type *Ty,
3348 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3401 PPC64_SVR4_ABIInfo::isPromotableTypeForABI(QualType Ty) const { in isPromotableTypeForABI()
3403 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in isPromotableTypeForABI()
3404 Ty = EnumTy->getDecl()->getIntegerType(); in isPromotableTypeForABI()
3407 if (Ty->isPromotableIntegerType()) in isPromotableTypeForABI()
3412 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) in isPromotableTypeForABI()
3427 PPC64_SVR4_ABIInfo::isAlignedParamType(QualType Ty, bool &Align32) const { in isAlignedParamType() argument
3431 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) in isAlignedParamType()
3432 Ty = CTy->getElementType(); in isAlignedParamType()
3436 if (IsQPXVectorTy(Ty)) { in isAlignedParamType()
3437 if (getContext().getTypeSize(Ty) > 128) in isAlignedParamType()
3441 } else if (Ty->isVectorType()) { in isAlignedParamType()
3442 return getContext().getTypeSize(Ty) == 128; in isAlignedParamType()
3448 const Type *EltType = isSingleElementStruct(Ty, getContext()); in isAlignedParamType()
3461 isAggregateTypeForABI(Ty) && isHomogeneousAggregate(Ty, Base, Members)) in isAlignedParamType()
3476 if (isAggregateTypeForABI(Ty) && getContext().getTypeAlign(Ty) >= 128) { in isAlignedParamType()
3477 if (HasQPX && getContext().getTypeAlign(Ty) >= 256) in isAlignedParamType()
3488 bool ABIInfo::isHomogeneousAggregate(QualType Ty, const Type *&Base, in isHomogeneousAggregate() argument
3490 if (const ConstantArrayType *AT = getContext().getAsConstantArrayType(Ty)) { in isHomogeneousAggregate()
3497 } else if (const RecordType *RT = Ty->getAs<RecordType>()) { in isHomogeneousAggregate()
3549 getContext().getTypeSize(Ty)) in isHomogeneousAggregate()
3553 if (const ComplexType *CT = Ty->getAs<ComplexType>()) { in isHomogeneousAggregate()
3555 Ty = CT->getElementType(); in isHomogeneousAggregate()
3559 if (!isHomogeneousAggregateBaseType(Ty)) in isHomogeneousAggregate()
3565 const Type *TyPtr = Ty.getTypePtr(); in isHomogeneousAggregate()
3576 bool PPC64_SVR4_ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
3579 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isHomogeneousAggregateBaseType()
3585 if (const VectorType *VT = Ty->getAs<VectorType>()) { in isHomogeneousAggregateBaseType()
3586 if (getContext().getTypeSize(VT) == 128 || IsQPXVectorTy(Ty)) in isHomogeneousAggregateBaseType()
3604 PPC64_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
3605 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
3607 if (Ty->isAnyComplexType()) in classifyArgumentType()
3612 if (Ty->isVectorType() && !IsQPXVectorTy(Ty)) { in classifyArgumentType()
3613 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
3622 if (isAggregateTypeForABI(Ty)) { in classifyArgumentType()
3623 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
3627 uint64_t ABIAlign = isAlignedParamType(Ty, Align32) ? in classifyArgumentType()
3629 uint64_t TyAlign = getContext().getTypeAlign(Ty) / 8; in classifyArgumentType()
3635 isHomogeneousAggregate(Ty, Base, Members)) { in classifyArgumentType()
3645 uint64_t Bits = getContext().getTypeSize(Ty); in classifyArgumentType()
3671 return (isPromotableTypeForABI(Ty) ? in classifyArgumentType()
3732 QualType Ty, in EmitVAArg() argument
3743 if (isAlignedParamType(Ty, Align32)) { in EmitVAArg()
3756 unsigned SizeInBytes = CGF.getContext().getTypeSize(Ty) / 8; in EmitVAArg()
3760 if (const ComplexType *CTy = Ty->getAs<ComplexType>()) { in EmitVAArg()
3794 CGF.CreateTempAlloca(CGT.ConvertTypeForMem(Ty), "vacplx"); in EmitVAArg()
3813 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
3898 bool isHomogeneousAggregateBaseType(QualType Ty) const override;
3899 bool isHomogeneousAggregateSmallEnough(const Type *Ty,
3902 bool isIllegalVectorType(QualType Ty) const;
3912 llvm::Value *EmitDarwinVAArg(llvm::Value *VAListAddr, QualType Ty,
3915 llvm::Value *EmitAAPCSVAArg(llvm::Value *VAListAddr, QualType Ty,
3918 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
3920 return isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF) in EmitVAArg()
3921 : EmitAAPCSVAArg(VAListAddr, Ty, CGF); in EmitVAArg()
3942 ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
3943 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
3946 if (isIllegalVectorType(Ty)) { in classifyArgumentType()
3947 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
3970 if (!isAggregateTypeForABI(Ty)) { in classifyArgumentType()
3972 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
3973 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
3975 return (Ty->isPromotableIntegerType() && isDarwinPCS() in classifyArgumentType()
3982 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
3989 if (isEmptyRecord(getContext(), Ty, true)) { in classifyArgumentType()
3999 if (isHomogeneousAggregate(Ty, Base, Members)) { in classifyArgumentType()
4005 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
4007 unsigned Alignment = getContext().getTypeAlign(Ty); in classifyArgumentType()
4060 bool AArch64ABIInfo::isIllegalVectorType(QualType Ty) const { in isIllegalVectorType()
4061 if (const VectorType *VT = Ty->getAs<VectorType>()) { in isIllegalVectorType()
4073 bool AArch64ABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
4078 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isHomogeneousAggregateBaseType()
4081 } else if (const VectorType *VT = Ty->getAs<VectorType>()) { in isHomogeneousAggregateBaseType()
4095 QualType Ty, in EmitAAPCSVAArg() argument
4097 ABIArgInfo AI = classifyArgumentType(Ty); in EmitAAPCSVAArg()
4100 llvm::Type *BaseTy = CGF.ConvertType(Ty); in EmitAAPCSVAArg()
4132 int RegSize = IsIndirect ? 8 : getContext().getTypeSize(Ty) / 8; in EmitAAPCSVAArg()
4170 if (!IsFPR && !IsIndirect && Ctx.getTypeAlign(Ty) > 64) { in EmitAAPCSVAArg()
4171 int Align = Ctx.getTypeAlign(Ty) / 8; in EmitAAPCSVAArg()
4209 llvm::Type *MemTy = llvm::PointerType::getUnqual(CGF.ConvertTypeForMem(Ty)); in EmitAAPCSVAArg()
4219 bool IsHFA = isHomogeneousAggregate(Ty, Base, NumMembers); in EmitAAPCSVAArg()
4251 (IsHFA || !isAggregateTypeForABI(Ty)) && in EmitAAPCSVAArg()
4252 Ctx.getTypeSize(Ty) < (BeAlign * 8)) { in EmitAAPCSVAArg()
4253 int Offset = BeAlign - Ctx.getTypeSize(Ty) / 8; in EmitAAPCSVAArg()
4278 if (!IsIndirect && Ctx.getTypeAlign(Ty) > 64) { in EmitAAPCSVAArg()
4279 int Align = Ctx.getTypeAlign(Ty) / 8; in EmitAAPCSVAArg()
4297 StackSize = Ctx.getTypeSize(Ty) / 8; in EmitAAPCSVAArg()
4309 if (CGF.CGM.getDataLayout().isBigEndian() && !isAggregateTypeForABI(Ty) && in EmitAAPCSVAArg()
4310 Ctx.getTypeSize(Ty) < 64) { in EmitAAPCSVAArg()
4311 int Offset = 8 - Ctx.getTypeSize(Ty) / 8; in EmitAAPCSVAArg()
4339 llvm::Value *AArch64ABIInfo::EmitDarwinVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitDarwinVAArg() argument
4344 if (!isAggregateTypeForABI(Ty) && !isIllegalVectorType(Ty)) in EmitDarwinVAArg()
4347 uint64_t Size = CGF.getContext().getTypeSize(Ty) / 8; in EmitDarwinVAArg()
4348 uint64_t Align = CGF.getContext().getTypeAlign(Ty) / 8; in EmitDarwinVAArg()
4352 bool isHA = isHomogeneousAggregate(Ty, Base, Members); in EmitDarwinVAArg()
4370 if (isEmptyRecord(getContext(), Ty, true)) { in EmitDarwinVAArg()
4372 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitDarwinVAArg()
4393 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitDarwinVAArg()
4449 bool isIllegalVectorType(QualType Ty) const;
4451 bool isHomogeneousAggregateBaseType(QualType Ty) const override;
4452 bool isHomogeneousAggregateSmallEnough(const Type *Ty,
4457 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
4617 ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, in classifyArgumentType() argument
4628 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
4631 if (isIllegalVectorType(Ty)) { in classifyArgumentType()
4632 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
4651 if (!isAggregateTypeForABI(Ty)) { in classifyArgumentType()
4653 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) { in classifyArgumentType()
4654 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
4657 return (Ty->isPromotableIntegerType() ? ABIArgInfo::getExtend() in classifyArgumentType()
4661 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
4666 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
4674 if (isHomogeneousAggregate(Ty, Base, Members)) { in classifyArgumentType()
4686 uint64_t TyAlign = getContext().getTypeAlign(Ty) / 8; in classifyArgumentType()
4691 if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64)) { in classifyArgumentType()
4701 if (getContext().getTypeAlign(Ty) <= 32) { in classifyArgumentType()
4703 SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32; in classifyArgumentType()
4706 SizeRegs = (getContext().getTypeSize(Ty) + 63) / 64; in classifyArgumentType()
4712 static bool isIntegerLikeType(QualType Ty, ASTContext &Context, in isIntegerLikeType() argument
4718 uint64_t Size = Context.getTypeSize(Ty); in isIntegerLikeType()
4725 if (Ty->isVectorType()) in isIntegerLikeType()
4729 if (Ty->isRealFloatingType()) in isIntegerLikeType()
4733 if (Ty->getAs<BuiltinType>() || Ty->isPointerType()) in isIntegerLikeType()
4737 if (const ComplexType *CT = Ty->getAs<ComplexType>()) in isIntegerLikeType()
4744 const RecordType *RT = Ty->getAs<RecordType>(); in isIntegerLikeType()
4882 bool ARMABIInfo::isIllegalVectorType(QualType Ty) const { in isIllegalVectorType()
4883 if (const VectorType *VT = Ty->getAs<VectorType>()) { in isIllegalVectorType()
4893 bool ARMABIInfo::isHomogeneousAggregateBaseType(QualType Ty) const { in isHomogeneousAggregateBaseType()
4896 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) { in isHomogeneousAggregateBaseType()
4901 } else if (const VectorType *VT = Ty->getAs<VectorType>()) { in isHomogeneousAggregateBaseType()
4914 llvm::Value *ARMABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
4923 if (isEmptyRecord(getContext(), Ty, true)) { in EmitVAArg()
4925 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
4929 uint64_t Size = CGF.getContext().getTypeSize(Ty) / 8; in EmitVAArg()
4930 uint64_t TyAlign = CGF.getContext().getTypeAlign(Ty) / 8; in EmitVAArg()
4941 if (isIllegalVectorType(Ty) && Size > 32) { in EmitVAArg()
4966 else if (TyAlign < CGF.getContext().getTypeAlign(Ty) / 8) { in EmitVAArg()
4973 CharUnits CharSize = getContext().getTypeSizeInChars(Ty); in EmitVAArg()
4974 llvm::Value *AlignedTemp = CGF.CreateTempAlloca(CGF.ConvertType(Ty), in EmitVAArg()
4984 llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
5001 ABIArgInfo classifyArgumentType(QualType Ty) const;
5004 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5037 ABIArgInfo NVPTXABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
5039 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
5040 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
5043 if (isAggregateTypeForABI(Ty)) in classifyArgumentType()
5046 return (Ty->isPromotableIntegerType() ? in classifyArgumentType()
5063 llvm::Value *NVPTXABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
5142 bool isPromotableIntegerType(QualType Ty) const;
5143 bool isCompoundType(QualType Ty) const;
5144 bool isFPArgumentType(QualType Ty) const;
5156 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5168 bool SystemZABIInfo::isPromotableIntegerType(QualType Ty) const { in isPromotableIntegerType()
5170 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in isPromotableIntegerType()
5171 Ty = EnumTy->getDecl()->getIntegerType(); in isPromotableIntegerType()
5174 if (Ty->isPromotableIntegerType()) in isPromotableIntegerType()
5178 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) in isPromotableIntegerType()
5189 bool SystemZABIInfo::isCompoundType(QualType Ty) const { in isCompoundType()
5190 return (Ty->isAnyComplexType() || in isCompoundType()
5191 Ty->isVectorType() || in isCompoundType()
5192 isAggregateTypeForABI(Ty)); in isCompoundType()
5195 bool SystemZABIInfo::isFPArgumentType(QualType Ty) const { in isFPArgumentType()
5196 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) in isFPArgumentType()
5205 if (const RecordType *RT = Ty->getAsStructureType()) { in isFPArgumentType()
5251 llvm::Value *SystemZABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
5263 Ty = CGF.getContext().getCanonicalType(Ty); in EmitVAArg()
5264 llvm::Type *ArgTy = CGF.ConvertTypeForMem(Ty); in EmitVAArg()
5266 ABIArgInfo AI = classifyArgumentType(Ty); in EmitVAArg()
5277 UnpaddedBitSize = getContext().getTypeSize(Ty); in EmitVAArg()
5379 ABIArgInfo SystemZABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
5381 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
5385 if (isPromotableIntegerType(Ty)) in classifyArgumentType()
5389 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
5394 if (const RecordType *RT = Ty->getAs<RecordType>()) { in classifyArgumentType()
5403 if (isFPArgumentType(Ty)) { in classifyArgumentType()
5415 if (isCompoundType(Ty)) in classifyArgumentType()
5470 llvm::Type* HandleAggregates(QualType Ty, uint64_t TySize) const;
5481 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5536 llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty, uint64_t TySize) const { in HandleAggregates() argument
5544 if (Ty->isComplexType()) in HandleAggregates()
5545 return CGT.ConvertType(Ty); in HandleAggregates()
5547 const RecordType *RT = Ty->getAs<RecordType>(); in HandleAggregates()
5567 const QualType Ty = i->getType(); in HandleAggregates() local
5568 const BuiltinType *BT = Ty->getAs<BuiltinType>(); in HandleAggregates()
5601 MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const { in classifyArgumentType() argument
5602 Ty = useFirstFieldIfTransparentUnion(Ty); in classifyArgumentType()
5605 uint64_t TySize = getContext().getTypeSize(Ty); in classifyArgumentType()
5606 uint64_t Align = getContext().getTypeAlign(Ty) / 8; in classifyArgumentType()
5613 if (isAggregateTypeForABI(Ty) || Ty->isVectorType()) { in classifyArgumentType()
5618 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) { in classifyArgumentType()
5627 ABIArgInfo::getDirect(HandleAggregates(Ty, TySize), 0, in classifyArgumentType()
5634 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
5635 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
5638 if (Ty->isIntegralOrEnumerationType()) in classifyArgumentType()
5737 llvm::Value* MipsABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
5746 if ((Ty->isIntegerType() && in EmitVAArg()
5747 CGF.getContext().getIntWidth(Ty) < SlotSizeInBits) || in EmitVAArg()
5748 (Ty->isPointerType() && PtrWidth < SlotSizeInBits)) { in EmitVAArg()
5749 Ty = CGF.getContext().getIntTypeForBitwidth(SlotSizeInBits, in EmitVAArg()
5750 Ty->isSignedIntegerType()); in EmitVAArg()
5757 std::min(getContext().getTypeAlign(Ty) / 8, StackAlignInBytes); in EmitVAArg()
5758 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
5775 unsigned ArgSizeInBits = CGF.getContext().getTypeSize(Ty); in EmitVAArg()
5894 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
5917 ABIArgInfo HexagonABIInfo::classifyArgumentType(QualType Ty) const { in classifyArgumentType()
5918 if (!isAggregateTypeForABI(Ty)) { in classifyArgumentType()
5920 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyArgumentType()
5921 Ty = EnumTy->getDecl()->getIntegerType(); in classifyArgumentType()
5923 return (Ty->isPromotableIntegerType() ? in classifyArgumentType()
5928 if (isEmptyRecord(getContext(), Ty, true)) in classifyArgumentType()
5931 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyArgumentType()
5934 uint64_t Size = getContext().getTypeSize(Ty); in classifyArgumentType()
5985 llvm::Value *HexagonABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
5995 llvm::PointerType::getUnqual(CGF.ConvertType(Ty)); in EmitVAArg()
5999 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, 4); in EmitVAArg()
6082 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
6133 void addFloat(uint64_t Offset, llvm::Type *Ty, unsigned Bits) { in addFloat()
6141 Elems.push_back(Ty); in addFloat()
6178 bool isUsableType(llvm::StructType *Ty) const { in isUsableType()
6179 return llvm::makeArrayRef(Elems) == Ty->elements(); in isUsableType()
6194 SparcV9ABIInfo::classifyType(QualType Ty, unsigned SizeLimit) const { in classifyType() argument
6195 if (Ty->isVoidType()) in classifyType()
6198 uint64_t Size = getContext().getTypeSize(Ty); in classifyType()
6206 if (const EnumType *EnumTy = Ty->getAs<EnumType>()) in classifyType()
6207 Ty = EnumTy->getDecl()->getIntegerType(); in classifyType()
6210 if (Size < 64 && Ty->isIntegerType()) in classifyType()
6214 if (!isAggregateTypeForABI(Ty)) in classifyType()
6219 if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) in classifyType()
6224 llvm::StructType *StrTy = dyn_cast<llvm::StructType>(CGT.ConvertType(Ty)); in classifyType()
6241 llvm::Value *SparcV9ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
6243 ABIArgInfo AI = classifyType(Ty, 16 * 8); in EmitVAArg()
6244 llvm::Type *ArgTy = CGT.ConvertType(Ty); in EmitVAArg()
6449 llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
6464 llvm::Value *XCoreABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, in EmitVAArg() argument
6474 ABIArgInfo AI = classifyArgumentType(Ty); in EmitVAArg()
6475 llvm::Type *ArgTy = CGT.ConvertType(Ty); in EmitVAArg()