aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2012-02-19 16:03:09 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2012-02-19 16:03:09 +0000
commit972edf0534d8a50f87fac1d0ff34eb22f593df11 (patch)
treeb0c119edcbbf2e81d8d9efb3027cc82671e28146 /lib/CodeGen/CGExprAgg.cpp
parent924db71fc8f6076c532c8c2ae93acc7f477452c8 (diff)
Make heap-allocation of std::initializer_list 'work'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 13f5bc47d5..afe70a5dda 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -1263,19 +1263,17 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
Alignment, isVolatile);
}
-void CodeGenFunction::MaybeEmitStdInitializerListCleanup(LValue lvalue,
- const Expr *init) {
+void CodeGenFunction::MaybeEmitStdInitializerListCleanup(llvm::Value *loc,
+ const Expr *init) {
const ExprWithCleanups *cleanups = dyn_cast<ExprWithCleanups>(init);
- if (!cleanups)
- return; // Nothing interesting here.
- init = cleanups->getSubExpr();
+ if (cleanups)
+ init = cleanups->getSubExpr();
if (isa<InitListExpr>(init) &&
cast<InitListExpr>(init)->initializesStdInitializerList()) {
// We initialized this std::initializer_list with an initializer list.
// A backing array was created. Push a cleanup for it.
- EmitStdInitializerListCleanup(lvalue.getAddress(),
- cast<InitListExpr>(init));
+ EmitStdInitializerListCleanup(loc, cast<InitListExpr>(init));
}
}