summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-05-12 17:00:20 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-05-12 17:00:20 +0000
commitbbfd054746b07904599a35c7fc457da4e33318a9 (patch)
treebfbb262e49312b2658af0c9cb331fb8b4d3df139 /clang/lib/CodeGen
parent203e2e8dd8c55496a6e47f5b1aacc22f4324711c (diff)
downloadbcm5719-llvm-bbfd054746b07904599a35c7fc457da4e33318a9.tar.gz
bcm5719-llvm-bbfd054746b07904599a35c7fc457da4e33318a9.zip
Darwin x86-32 ABI: Now that structure passing is farther along, we
don't need special treatment for unions. llvm-svn: 71559
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index a1427293439..1df9b0be635 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -446,18 +446,11 @@ ABIArgInfo X86_32ABIInfo::classifyReturnType(QualType RetTy,
}
}
- uint64_t Size = Context.getTypeSize(RetTy);
- if (isRegisterSize(Size)) {
- // Always return in register for unions for now.
- // FIXME: This is wrong, but better than treating as a
- // structure.
- if (RetTy->isUnionType())
- return ABIArgInfo::getCoerce(llvm::IntegerType::get(Size));
-
- // Small structures which are register sized are generally returned
- // in a register.
- if (X86_32ABIInfo::shouldReturnTypeInRegister(RetTy, Context))
- return ABIArgInfo::getCoerce(llvm::IntegerType::get(Size));
+ // Small structures which are register sized are generally returned
+ // in a register.
+ if (X86_32ABIInfo::shouldReturnTypeInRegister(RetTy, Context)) {
+ uint64_t Size = Context.getTypeSize(RetTy);
+ return ABIArgInfo::getCoerce(llvm::IntegerType::get(Size));
}
return ABIArgInfo::getIndirect(0);
OpenPOWER on IntegriCloud