@@ -3943,40 +3943,18 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs,
3943
3943
// Otherwise, coerce it to a small integer.
3944
3944
return ABIArgInfo::getDirect (llvm::IntegerType::get (getVMContext (), Width));
3945
3945
}
3946
+ // Bool type is always extended to the ABI, other builtin types are not
3947
+ // extended.
3948
+ const BuiltinType *BT = Ty->getAs <BuiltinType>();
3949
+ if (BT && BT->getKind () == BuiltinType::Bool)
3950
+ return ABIArgInfo::getExtend (Ty);
3946
3951
3947
- if (const BuiltinType *BT = Ty->getAs <BuiltinType>()) {
3948
- switch (BT->getKind ()) {
3949
- case BuiltinType::Bool:
3950
- // Bool type is always extended to the ABI, other builtin types are not
3951
- // extended.
3952
- return ABIArgInfo::getExtend (Ty);
3953
-
3954
- case BuiltinType::LongDouble:
3955
- // Mingw64 GCC uses the old 80 bit extended precision floating point
3956
- // unit. It passes them indirectly through memory.
3957
- if (IsMingw64) {
3958
- const llvm::fltSemantics *LDF = &getTarget ().getLongDoubleFormat ();
3959
- if (LDF == &llvm::APFloat::x87DoubleExtended ())
3960
- return ABIArgInfo::getIndirect (Align, /* ByVal=*/ false );
3961
- break ;
3962
- }
3963
-
3964
- case BuiltinType::Int128:
3965
- case BuiltinType::UInt128:
3966
- // If it's a parameter type, the normal ABI rule is that arguments larger
3967
- // than 8 bytes are passed indirectly. GCC follows it. We follow it too,
3968
- // even though it isn't particularly efficient.
3969
- if (!IsReturnType)
3970
- return ABIArgInfo::getIndirect (Align, /* ByVal=*/ false );
3971
-
3972
- // Mingw64 GCC returns i128 in XMM0. Coerce to v2i64 to handle that.
3973
- // Clang matches them for compatibility.
3974
- return ABIArgInfo::getDirect (
3975
- llvm::VectorType::get (llvm::Type::getInt64Ty (getVMContext ()), 2 ));
3976
-
3977
- default :
3978
- break ;
3979
- }
3952
+ // Mingw64 GCC uses the old 80 bit extended precision floating point unit. It
3953
+ // passes them indirectly through memory.
3954
+ if (IsMingw64 && BT && BT->getKind () == BuiltinType::LongDouble) {
3955
+ const llvm::fltSemantics *LDF = &getTarget ().getLongDoubleFormat ();
3956
+ if (LDF == &llvm::APFloat::x87DoubleExtended ())
3957
+ return ABIArgInfo::getIndirect (Align, /* ByVal=*/ false );
3980
3958
}
3981
3959
3982
3960
return ABIArgInfo::getDirect ();
0 commit comments