From 2f1a6c3f015c6a7db51ef51f99519f88c43f894a Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 31 Oct 2011 16:27:11 +0000 Subject: In x86_64, when calling an Objective-C method that returns a _Complex long double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil. llvm-svn: 143350 --- clang/lib/Basic/Targets.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Basic/Targets.cpp') diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 60642b383a9..da32c93254d 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -2245,6 +2245,9 @@ public: // Use fpret only for long double. RealTypeUsesObjCFPRet = (1 << TargetInfo::LongDouble); + // Use fp2ret for _Complex long double. + ComplexLongDoubleUsesFP2Ret = true; + // x86-64 has atomics up to 16 bytes. // FIXME: Once the backend is fixed, increase MaxAtomicInlineWidth to 128 // on CPUs with cmpxchg16b -- cgit v1.2.3