Make sure to initialize local variables, even if they were ignored by
ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64187 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index fbc421c..f90d31c 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1266,6 +1266,13 @@
}
case ABIArgInfo::Ignore:
+ // Initialize the local variable appropriately.
+ if (hasAggregateLLVMType(Ty)) {
+ EmitParmDecl(*Arg, CreateTempAlloca(ConvertType(Ty)));
+ } else {
+ EmitParmDecl(*Arg, llvm::UndefValue::get(ConvertType(Arg->getType())));
+ }
+
// Skip increment, no matching LLVM parameter.
continue;