summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-12-25 14:26:58 +0000
committerdim <dim@FreeBSD.org>2015-12-25 14:26:58 +0000
commit1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c (patch)
tree31a414b9b5f25347b7ed9a8786c34bdb277d6127 /lib/CodeGen/TargetInfo.cpp
parent4238dc458ed9a048965af111b979fd51d288f22c (diff)
downloadFreeBSD-src-1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c.zip
FreeBSD-src-1e9b8d38881c3213d1e67b0c47ab9b2c00721a5c.tar.gz
Import clang 3.7.1 release (r255217).
Diffstat (limited to 'lib/CodeGen/TargetInfo.cpp')
-rw-r--r--lib/CodeGen/TargetInfo.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 48a8b37..25bd733 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -1552,12 +1552,10 @@ public:
/// WinX86_64ABIInfo - The Windows X86_64 ABI information.
class WinX86_64ABIInfo : public ABIInfo {
-
- ABIArgInfo classify(QualType Ty, unsigned &FreeSSERegs,
- bool IsReturnType) const;
-
public:
- WinX86_64ABIInfo(CodeGen::CodeGenTypes &CGT) : ABIInfo(CGT) {}
+ WinX86_64ABIInfo(CodeGen::CodeGenTypes &CGT)
+ : ABIInfo(CGT),
+ IsMingw64(getTarget().getTriple().isWindowsGNUEnvironment()) {}
void computeInfo(CGFunctionInfo &FI) const override;
@@ -1574,6 +1572,12 @@ public:
// FIXME: Assumes vectorcall is in use.
return isX86VectorCallAggregateSmallEnough(NumMembers);
}
+
+private:
+ ABIArgInfo classify(QualType Ty, unsigned &FreeSSERegs,
+ bool IsReturnType) const;
+
+ bool IsMingw64;
};
class X86_64TargetCodeGenInfo : public TargetCodeGenInfo {
@@ -3070,11 +3074,6 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs,
if (RT->getDecl()->hasFlexibleArrayMember())
return ABIArgInfo::getIndirect(0, /*ByVal=*/false);
-
- // FIXME: mingw-w64-gcc emits 128-bit struct as i128
- if (Width == 128 && getTarget().getTriple().isWindowsGNUEnvironment())
- return ABIArgInfo::getDirect(llvm::IntegerType::get(getVMContext(),
- Width));
}
// vectorcall adds the concept of a homogenous vector aggregate, similar to
@@ -3116,6 +3115,14 @@ ABIArgInfo WinX86_64ABIInfo::classify(QualType Ty, unsigned &FreeSSERegs,
if (BT && BT->getKind() == BuiltinType::Bool)
return ABIArgInfo::getExtend();
+ // Mingw64 GCC uses the old 80 bit extended precision floating point unit. It
+ // passes them indirectly through memory.
+ if (IsMingw64 && BT && BT->getKind() == BuiltinType::LongDouble) {
+ const llvm::fltSemantics *LDF = &getTarget().getLongDoubleFormat();
+ if (LDF == &llvm::APFloat::x87DoubleExtended)
+ return ABIArgInfo::getIndirect(Align, /*ByVal=*/false);
+ }
+
return ABIArgInfo::getDirect();
}
OpenPOWER on IntegriCloud