From: Chris Lattner Date: Thu, 12 Jul 2007 00:39:48 +0000 (+0000) Subject: Evaluate the initializer for automatic variables. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1978596a6f490e674369634900ffb773bdb49e94;p=clang Evaluate the initializer for automatic variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39771 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CodeGen/CGDecl.cpp b/CodeGen/CGDecl.cpp index 822aca3f55..1cce124a82 100644 --- a/CodeGen/CGDecl.cpp +++ b/CodeGen/CGDecl.cpp @@ -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.