[cfe-commits] r63294 - /cfe/trunk/lib/CodeGen/CGCall.cpp
Daniel Dunbar
daniel at zuster.org
Thu Jan 29 00:24:57 PST 2009
Author: ddunbar
Date: Thu Jan 29 02:24:57 2009
New Revision: 63294
URL: http://llvm.org/viewvc/llvm-project?rev=63294&view=rev
Log:
ABI: When emitting calls which return an ignored argument, make sure
to still return an RValue of the correct type.
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=63294&r1=63293&r2=63294&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Jan 29 02:24:57 2009
@@ -1256,7 +1256,14 @@
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");
More information about the cfe-commits
mailing list