summaryrefslogtreecommitdiffstats
path: root/clang/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
commit012468aa7f03884270d831c6452cc50bf05f14f8 (patch)
treebb8b32b41d4e088f9dae54ed988269a6810f3eb9 /clang/lib/CodeGen/CGCall.cpp
parentc0924a0632c842e18cf089172cf9ca7aadc96d5a (diff)
downloadbcm5719-llvm-012468aa7f03884270d831c6452cc50bf05f14f8.tar.gz
bcm5719-llvm-012468aa7f03884270d831c6452cc50bf05f14f8.zip
ABI: When emitting calls which return an ignored argument, make sure
to still return an RValue of the correct type. llvm-svn: 63294
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index ee854f6ccee..6ffe8c328ca 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/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");
OpenPOWER on IntegriCloud