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
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");