]> granicus.if.org Git - clang/commitdiff
Evaluate the initializer for automatic variables.
authorChris Lattner <sabre@nondot.org>
Thu, 12 Jul 2007 00:39:48 +0000 (00:39 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 12 Jul 2007 00:39:48 +0000 (00:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39771 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CGDecl.cpp

index 822aca3f557dcc74992c7f8c4673436f056cdecc..1cce124a8290c40299be3d4f058fd0358222c9c1 100644 (file)
@@ -84,7 +84,9 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const BlockVarDecl &D) {
   assert(DMEntry == 0 && "Decl already exists in localdeclmap!");
   DMEntry = DeclPtr;
   
-  // FIXME: Evaluate initializer.
+  // If this local has an initializer, emit it now.
+  if (const Expr *Init = D.getInit())
+    EmitStoreThroughLValue(EmitExpr(Init), LValue::MakeAddr(DeclPtr), Ty);
 }
 
 /// Emit an alloca for the specified parameter and set up LocalDeclMap.