aboutsummaryrefslogtreecommitdiff
path: root/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CodeGen/CGDecl.cpp')
-rw-r--r--CodeGen/CGDecl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/CodeGen/CGDecl.cpp b/CodeGen/CGDecl.cpp
index 8489cbabd8..223228817c 100644
--- a/CodeGen/CGDecl.cpp
+++ b/CodeGen/CGDecl.cpp
@@ -85,8 +85,12 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const BlockVarDecl &D) {
// If this local has an initializer, emit it now.
if (const Expr *Init = D.getInit()) {
- // FIXME: This could be much better for aggregates / complex.
- EmitStoreThroughLValue(EmitAnyExpr(Init), LValue::MakeAddr(DeclPtr), Ty);
+ if (Init->getType()->isComplexType()) {
+ EmitComplexExprIntoAddr(Init, DeclPtr);
+ } else {
+ // FIXME: This could be much better for aggregates.
+ EmitStoreThroughLValue(EmitAnyExpr(Init), LValue::MakeAddr(DeclPtr), Ty);
+ }
}
}