summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-10 00:06:49 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-10 00:06:49 +0000
commitd5f1f55e288eae1dbc97aba37752b3ae01224132 (patch)
tree813292fe4d52c214c8a84dd3041776c000e83bf8 /clang/lib/CodeGen
parente5ade4a9a129dfe871e2236dcc8fbca60e870866 (diff)
downloadbcm5719-llvm-d5f1f55e288eae1dbc97aba37752b3ae01224132.tar.gz
bcm5719-llvm-d5f1f55e288eae1dbc97aba37752b3ae01224132.zip
Make sure to initialize local variables, even if they were ignored by
ABI. llvm-svn: 64187
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index fbc421cb9e6..f90d31cd0b0 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1266,6 +1266,13 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
}
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;
OpenPOWER on IntegriCloud