Home | History | Annotate | Download | only in CodeGen

Lines Matching defs:ty

65     if (llvm::Type *Ty = getCoerceToType())
66 Ty->print(OS);
268 static bool is32Or64BitBasicType(QualType Ty, ASTContext &Context) {
269 if (!Ty->getAs<BuiltinType>() && !Ty->hasPointerRepresentation() &&
270 !Ty->isAnyComplexType() && !Ty->isEnumeralType() &&
271 !Ty->isBlockPointerType())
274 uint64_t Size = Context.getTypeSize(Ty);
287 static bool canExpandIndirectArgument(QualType Ty, ASTContext &Context) {
289 const RecordType *RT = Ty->getAs<RecordType>();
319 if (Size != Context.getTypeSize(Ty))
344 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
354 llvm::Value *DefaultABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
359 ABIArgInfo DefaultABIInfo::classifyArgumentType(QualType Ty) const {
360 if (isAggregateTypeForABI(Ty)) {
363 if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
370 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
371 Ty = EnumTy->getDecl()->getIntegerType();
373 return (Ty->isPromotableIntegerType() ?
404 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
424 llvm::Value *PNaClABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
429 ABIArgInfo PNaClABIInfo::classifyArgumentType(QualType Ty,
431 if (isAggregateTypeForABI(Ty)) {
435 if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
442 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
443 Ty = EnumTy->getDecl()->getIntegerType();
445 ABIArgInfo BaseInfo = (Ty->isPromotableIntegerType() ?
449 unsigned SizeInRegs = (getContext().getTypeSize(Ty) + 31) / 32;
488 llvm::Type* Ty) {
489 if ((Constraint == "y" || Constraint == "&y") && Ty->isVectorTy())
491 return Ty;
517 static bool shouldReturnTypeInRegister(QualType Ty, ASTContext &Context,
520 /// getIndirectResult - Give a source type \arg Ty, return a suitable result
522 ABIArgInfo getIndirectResult(QualType Ty, bool ByVal = true) const;
525 unsigned getTypeStackAlignInBytes(QualType Ty, unsigned Align) const;
527 Class classify(QualType Ty) const;
537 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
568 llvm::Type* Ty) const {
569 return X86AdjustInlineAsmType(CGF, Constraint, Ty);
578 bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty,
581 uint64_t Size = Context.getTypeSize(Ty);
587 if (Ty->isVectorType()) {
598 if (Ty->getAs<BuiltinType>() || Ty->hasPointerRepresentation() ||
599 Ty->isAnyComplexType() || Ty->isEnumeralType() ||
600 Ty->isBlockPointerType() || Ty->isMemberPointerType())
604 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty))
609 const RecordType *RT = Ty->getAs<RecordType>();
717 static bool isSSEVectorType(ASTContext &Context, QualType Ty) {
718 return Ty->getAs<VectorType>() && Context.getTypeSize(Ty) == 128;
721 static bool isRecordWithSSEVectorType(ASTContext &Context, QualType Ty) {
722 const RecordType *RT = Ty->getAs<RecordType>();
748 unsigned X86_32ABIInfo::getTypeStackAlignInBytes(QualType Ty,
762 if (Align >= 16 && (isSSEVectorType(getContext(), Ty) ||
763 isRecordWithSSEVectorType(getContext(), Ty)))
769 ABIArgInfo X86_32ABIInfo::getIndirectResult(QualType Ty, bool ByVal) const {
774 unsigned TypeAlign = getContext().getTypeAlign(Ty) / 8;
775 unsigned StackAlign = getTypeStackAlignInBytes(Ty, TypeAlign);
788 X86_32ABIInfo::Class X86_32ABIInfo::classify(QualType Ty) const {
789 const Type *T = isSingleElementStruct(Ty, getContext());
791 T = Ty.getTypePtr();
802 X86_32ABIInfo::classifyArgumentTypeWithReg(QualType Ty,
806 return classifyArgumentType(Ty);
808 Class C = classify(Ty);
810 return classifyArgumentType(Ty);
812 unsigned SizeInRegs = (getContext().getTypeSize(Ty) + 31) / 32;
814 return classifyArgumentType(Ty);
818 return classifyArgumentType(Ty);
824 ABIArgInfo Foo = classifyArgumentType(Ty);
839 ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty) const {
841 if (isAggregateTypeForABI(Ty)) {
843 if (const RecordType *RT = Ty->getAs<RecordType>()) {
847 return getIndirectResult(Ty, /*ByVal=*/false);
850 return getIndirectResult(Ty);
854 if (isEmptyRecord(getContext(), Ty, true))
861 if (getContext().getTypeSize(Ty) <= 4*32 &&
862 canExpandIndirectArgument(Ty, getContext()))
865 return getIndirectResult(Ty);
868 if (const VectorType *VT = Ty->getAs<VectorType>()) {
872 uint64_t Size = getContext().getTypeSize(Ty);
879 llvm::Type *IRType = CGT.ConvertType(Ty);
893 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
894 Ty = EnumTy->getDecl()->getIntegerType();
896 return (Ty->isPromotableIntegerType() ?
922 llvm::Value *X86_32ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
932 unsigned Align = CGF.getContext().getTypeAlignInChars(Ty).getQuantity();
933 Align = getTypeStackAlignInBytes(Ty, Align);
949 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
953 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, Align);
1079 llvm::Type *GetByteVectorType(QualType Ty) const;
1087 /// getIndirectResult - Give a source type \arg Ty, return a suitable result
1089 ABIArgInfo getIndirectReturnResult(QualType Ty) const;
1091 /// getIndirectResult - Give a source type \arg Ty, return a suitable result
1096 ABIArgInfo getIndirectResult(QualType Ty, unsigned freeIntRegs) const;
1100 ABIArgInfo classifyArgumentType(QualType Ty,
1105 bool IsIllegalVectorType(QualType Ty) const;
1127 llvm::Type *ty = info.getCoerceToType();
1128 if (llvm::VectorType *vectorTy = dyn_cast_or_null<llvm::VectorType>(ty))
1136 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
1143 ABIArgInfo classify(QualType Ty) const;
1150 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
1179 llvm::Type* Ty) const {
1180 return X86AdjustInlineAsmType(CGF, Constraint, Ty);
1195 if (getABIInfo().isPassedUsingAVXType(it->Ty)) {
1305 void X86_64ABIInfo::classify(QualType Ty, uint64_t OffsetBase,
1320 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
1341 if (const EnumType *ET = Ty->getAs<EnumType>()) {
1347 if (Ty->hasPointerRepresentation()) {
1352 if (Ty->isMemberPointerType()) {
1353 if (Ty->isMemberFunctionPointerType())
1360 if (const VectorType *VT = Ty->getAs<VectorType>()) {
1405 if (const ComplexType *CT = Ty->getAs<ComplexType>()) {
1408 uint64_t Size = getContext().getTypeSize(Ty);
1431 if (const ConstantArrayType *AT = getContext().getAsConstantArrayType(Ty)) {
1434 uint64_t Size = getContext().getTypeSize(Ty);
1474 if (const RecordType *RT = Ty->getAs<RecordType>()) {
1475 uint64_t Size = getContext().getTypeSize(Ty);
1590 ABIArgInfo X86_64ABIInfo::getIndirectReturnResult(QualType Ty) const {
1593 if (!isAggregateTypeForABI(Ty)) {
1595 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
1596 Ty = EnumTy->getDecl()->getIntegerType();
1598 return (Ty->isPromotableIntegerType() ?
1605 bool X86_64ABIInfo::IsIllegalVectorType(QualType Ty) const {
1606 if (const VectorType *VecTy = Ty->getAs<VectorType>()) {
1616 ABIArgInfo X86_64ABIInfo::getIndirectResult(QualType Ty,
1626 if (!isAggregateTypeForABI(Ty) && !IsIllegalVectorType(Ty)) {
1628 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
1629 Ty = EnumTy->getDecl()->getIntegerType();
1631 return (Ty->isPromotableIntegerType() ?
1635 if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
1640 unsigned Align = std::max(getContext().getTypeAlign(Ty) / 8, 8U);
1664 uint64_t Size = getContext().getTypeSize(Ty);
1679 llvm::Type *X86_64ABIInfo::GetByteVectorType(QualType Ty) const {
1680 llvm::Type *IRType = CGT.ConvertType(Ty);
1712 static bool BitsContainNoUserData(QualType Ty, unsigned StartBit,
1717 unsigned TySize = (unsigned)Context.getTypeSize(Ty);
1721 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) {
1740 if (const RecordType *RT = Ty->getAs<RecordType>()) {
2089 QualType Ty, unsigned freeIntRegs, unsigned &neededInt, unsigned &neededSSE)
2093 classify(Ty, 0, Lo, Hi);
2121 if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
2123 return getIndirectResult(Ty, freeIntRegs);
2136 ResType = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 0, Ty, 0);
2142 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
2143 Ty = EnumTy->getDecl()->getIntegerType();
2145 if (Ty->isIntegralOrEnumerationType() &&
2146 Ty->isPromotableIntegerType())
2156 llvm::Type *IRType = CGT.ConvertType(Ty);
2157 ResType = GetSSETypeAtOffset(IRType, 0, Ty, 0);
2178 HighPart = GetINTEGERTypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8);
2188 HighPart = GetSSETypeAtOffset(CGT.ConvertType(Ty), 8, Ty, 8);
2201 ResType = GetByteVectorType(Ty);
2248 QualType Ty,
2259 uint64_t Align = CGF.getContext().getTypeAlign(Ty) / 8;
2275 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty);
2285 uint64_t SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8;
2296 llvm::Value *X86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2307 Ty = CGF.getContext().getCanonicalType(Ty);
2308 ABIArgInfo AI = classifyArgumentType(Ty, 0, neededInt, neededSSE);
2313 return EmitVAArgFromMemory(VAListAddr, Ty, CGF);
2364 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty);
2440 llvm::Value *MemAddr = EmitVAArgFromMemory(VAListAddr, Ty, CGF);
2452 ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty) const {
2454 if (Ty->isVoidType())
2457 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
2458 Ty = EnumTy->getDecl()->getIntegerType();
2460 uint64_t Size = getContext().getTypeSize(Ty);
2462 if (const RecordType *RT = Ty->getAs<RecordType>()) {
2484 if (Ty->isPromotableIntegerType())
2500 llvm::Value *WinX86_64ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2509 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
2513 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, 8);
2675 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
2753 static bool isHomogeneousAggregate(QualType Ty, const Type *&Base,
2757 if (const ConstantArrayType *AT = Context.getAsConstantArrayType(Ty)) {
2761 } else if (const RecordType *RT = Ty->getAs<RecordType>()) {
2779 if (const ComplexType *CT = Ty->getAs<ComplexType>()) {
2781 Ty = CT->getElementType();
2786 if (const BuiltinType *BT = Ty->getAs<BuiltinType>()) {
2791 } else if (const VectorType *VT = Ty->getAs<VectorType>()) {
2801 const Type *TyPtr = Ty.getTypePtr();
2817 ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty) const {
2818 if (!isAggregateTypeForABI(Ty)) {
2820 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
2821 Ty = EnumTy->getDecl()->getIntegerType();
2823 return (Ty->isPromotableIntegerType() ?
2828 if (isEmptyRecord(getContext(), Ty, true))
2833 if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
2839 if (isHomogeneousAggregate(Ty, Base, getContext())) {
2846 if (getContext().getTypeSizeInChars(Ty) > CharUnits::fromQuantity(64) ||
2847 getContext().getTypeAlign(Ty) > 64) {
2856 if (getContext().getTypeAlign(Ty) <= 32) {
2858 SizeRegs = (getContext().getTypeSize(Ty) + 31) / 32;
2861 SizeRegs = (getContext().getTypeSize(Ty) + 63) / 64;
2869 static bool isIntegerLikeType(QualType Ty, ASTContext &Context,
2875 uint64_t Size = Context.getTypeSize(Ty);
2882 if (Ty->isVectorType())
2886 if (Ty->isRealFloatingType())
2890 if (Ty->getAs<BuiltinType>() || Ty->isPointerType())
2894 if (const ComplexType *CT = Ty->getAs<ComplexType>())
2901 const RecordType *RT = Ty->getAs<RecordType>();
3034 llvm::Value *ARMABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3043 uint64_t TyAlign = CGF.getContext().getTypeAlign(Ty) / 8;
3053 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
3057 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, 4);
3077 ABIArgInfo classifyArgumentType(QualType Ty) const;
3080 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3101 ABIArgInfo NVPTXABIInfo::classifyArgumentType(QualType Ty) const {
3102 if (isAggregateTypeForABI(Ty))
3139 llvm::Value *NVPTXABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3186 bool isPromotableIntegerType(QualType Ty) const;
3198 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3212 bool MBlazeABIInfo::isPromotableIntegerType(QualType Ty) const {
3214 if (const BuiltinType *BT = Ty->getAs<BuiltinType>())
3230 llvm::Value *MBlazeABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3247 ABIArgInfo MBlazeABIInfo::classifyArgumentType(QualType Ty) const {
3248 if (isAggregateTypeForABI(Ty))
3251 return (isPromotableIntegerType(Ty) ?
3336 llvm::Type* HandleAggregates(QualType Ty, uint64_t TySize) const;
3347 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3389 llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty, uint64_t TySize) const {
3397 if (Ty->isComplexType())
3398 return CGT.ConvertType(Ty);
3400 const RecordType *RT = Ty->getAs<RecordType>();
3420 const QualType Ty = i->getType();
3421 const BuiltinType *BT = Ty->getAs<BuiltinType>();
3455 MipsABIInfo::classifyArgumentType(QualType Ty, uint64_t &Offset) const {
3457 uint64_t TySize = getContext().getTypeSize(Ty);
3458 uint64_t Align = getContext().getTypeAlign(Ty) / 8;
3465 if (isAggregateTypeForABI(Ty) || Ty->isVectorType()) {
3472 if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty)) {
3480 return ABIArgInfo::getDirect(HandleAggregates(Ty, TySize), 0,
3485 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
3486 Ty = EnumTy->getDecl()->getIntegerType();
3488 if (Ty->isPromotableIntegerType())
3578 llvm::Value* MipsABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3586 int64_t TypeAlign = getContext().getTypeAlign(Ty) / 8;
3587 llvm::Type *PTy = llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
3606 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, TypeAlign);
3724 virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3747 ABIArgInfo HexagonABIInfo::classifyArgumentType(QualType Ty) const {
3748 if (!isAggregateTypeForABI(Ty)) {
3750 if (const EnumType *EnumTy = Ty->getAs<EnumType>())
3751 Ty = EnumTy->getDecl()->getIntegerType();
3753 return (Ty->isPromotableIntegerType() ?
3758 if (isEmptyRecord(getContext(), Ty, true))
3763 if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
3766 uint64_t Size = getContext().getTypeSize(Ty);
3822 llvm::Value *HexagonABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
3832 llvm::PointerType::getUnqual(CGF.ConvertType(Ty));
3836 llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, 4);