Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63845 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index b7459b2..0d0dd33 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1430,17 +1430,11 @@
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.