From c79407fc4077ba5ba8a72e7fc64bfbba777f333c Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 5 Feb 2009 07:09:07 +0000 Subject: Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue. llvm-svn: 63845 --- clang/lib/CodeGen/CGCall.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'clang/lib/CodeGen/CGCall.cpp') diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index b7459b22299..0d0dd33d476 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1430,17 +1430,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, return RValue::get(CI); case ABIArgInfo::Ignore: - if (RetTy->isVoidType()) - return RValue::get(0); - // If we are ignoring an argument that had a result, make sure to // construct the appropriate return value for our caller. - 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))); + return GetUndefRValue(RetTy); + if (RetTy->isVoidType()) + return RValue::get(0); case ABIArgInfo::Coerce: { // FIXME: Avoid the conversion through memory if possible. -- cgit v1.2.3