[cfe-commits] r39771 - /cfe/trunk/CodeGen/CGDecl.cpp

Chris Lattner sabre at nondot.org
Wed Jul 11 17:39:48 PDT 2007


Author: lattner
Date: Wed Jul 11 19:39:48 2007
New Revision: 39771

URL: http://llvm.org/viewvc/llvm-project?rev=39771&view=rev
Log:
Evaluate the initializer for automatic variables.

Modified:
    cfe/trunk/CodeGen/CGDecl.cpp

Modified: cfe/trunk/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CGDecl.cpp?rev=39771&r1=39770&r2=39771&view=diff

==============================================================================
--- cfe/trunk/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/CodeGen/CGDecl.cpp Wed Jul 11 19:39:48 2007
@@ -84,7 +84,9 @@
   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.





More information about the cfe-commits mailing list