diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-05-12 17:00:20 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-05-12 17:00:20 +0000 |
commit | 836a0641ba4109b2c1254eec247ba4d2731bc2b7 (patch) | |
tree | 3789421ec68c73a2b92d8dac75e0135565ba3d85 /lib/CodeGen/CGCall.cpp | |
parent | 20e95c5eb400c864bbd4421624fdf7b25ce70f56 (diff) |
Darwin x86-32 ABI: Now that structure passing is farther along, we
don't need special treatment for unions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index a142729343..1df9b0be63 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/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); |