completely refactor codegen of scalar expressions out into its own CGExprScalar.cpp file.
This patch temporarily breaks compound assignment operators, but greatly simplifies many
things.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41355 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/CodeGen/CGDecl.cpp b/CodeGen/CGDecl.cpp
index 63b9d6f..8489cba 100644
--- a/CodeGen/CGDecl.cpp
+++ b/CodeGen/CGDecl.cpp
@@ -84,8 +84,10 @@
DMEntry = DeclPtr;
// If this local has an initializer, emit it now.
- if (const Expr *Init = D.getInit())
- EmitStoreThroughLValue(EmitExpr(Init), LValue::MakeAddr(DeclPtr), Ty);
+ if (const Expr *Init = D.getInit()) {
+ // FIXME: This could be much better for aggregates / complex.
+ EmitStoreThroughLValue(EmitAnyExpr(Init), LValue::MakeAddr(DeclPtr), Ty);
+ }
}
/// Emit an alloca for the specified parameter and set up LocalDeclMap.