summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2012-11-27 02:46:43 +0000
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>2012-11-27 02:46:43 +0000
commit90b22c9de6bed50f9954ea154248a69ab6261d78 (patch)
tree39c6a31c6e830b48c7d2e0583860853d5a3992d4 /clang/lib/CodeGen
parenta333f3fba10338d303097885d26f4a8b6fd0ef8e (diff)
downloadbcm5719-llvm-90b22c9de6bed50f9954ea154248a69ab6261d78.tar.gz
bcm5719-llvm-90b22c9de6bed50f9954ea154248a69ab6261d78.zip
This patch addresses an incompatibility relative to the 64-bit PowerPC
ELF ABI. Complex values are to be passed in registers as though the real and imaginary parts were passed as separate parameters. Prior to this patch, complex values were passed as byval aggregates. It turns out that specifying getDirect() for all complex types when classifying the argument type results in the desired behavior. The new Clang test case verifies that the correct LLVM IR is generated for caller and callee for each of the underlying types for _Complex. llvm-svn: 168673
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 4cff08125ac..1582eb63544 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -2777,6 +2777,9 @@ PPC64_SVR4_ABIInfo::isPromotableTypeForABI(QualType Ty) const {
ABIArgInfo
PPC64_SVR4_ABIInfo::classifyArgumentType(QualType Ty) const {
+ if (Ty->isAnyComplexType())
+ return ABIArgInfo::getDirect();
+
if (isAggregateTypeForABI(Ty)) {
// Records with non trivial destructors/constructors should not be passed
// by value.
OpenPOWER on IntegriCloud