aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-01-29 08:24:57 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-01-29 08:24:57 +0000
commitcc039fea2e985214e00387ce7404d358f56cf301 (patch)
tree032b48a26a885177c8215e8d474e1db2c7a9d6f2 /lib/CodeGen/CGCall.cpp
parent99037e5a2118bc194251a8033a0885810bf61c95 (diff)
ABI: When emitting calls which return an ignored argument, make sure
to still return an RValue of the correct type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index ee854f6cce..6ffe8c328c 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1256,7 +1256,14 @@ RValue CodeGenFunction::EmitCall(llvm::Value *Callee,
return RValue::get(RetTy->isVoidType() ? 0 : CI);
case ABIArgInfo::Ignore:
- return RValue::get(0);
+ if (RetTy->isVoidType())
+ return RValue::get(0);
+ if (CodeGenFunction::hasAggregateLLVMType(RetTy)) {
+ llvm::Value *Res =
+ llvm::UndefValue::get(llvm::PointerType::getUnqual(ConvertType(RetTy)));
+ return RValue::getAggregate(Res);
+ }
+ return RValue::get(llvm::UndefValue::get(ConvertType(RetTy)));
case ABIArgInfo::Coerce: {
llvm::Value *V = CreateTempAlloca(ConvertType(RetTy), "coerce");