Add map of VLA types and their sizes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60939 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 952c3b3..5c4246f 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/lib/CodeGen/CodeGenFunction.h
@@ -166,6 +166,11 @@
   /// statement range in current switch instruction.
   llvm::BasicBlock *CaseRangeBlock;
 
+  // VLASizeMap - This keeps track of the associated size for each VLA type
+  // FIXME: Maybe this could be a stack of maps that is pushed/popped as
+  // we enter/leave scopes.
+  llvm::DenseMap<const VariableArrayType*, llvm::Value*> VLASizeMap;
+  
   /// StackSaveValues - A stack(!) of stack save values. When a new scope is
   /// entered, a null is pushed on this stack. If a VLA is emitted, then 
   /// the return value of llvm.stacksave() is stored at the top of this stack.
@@ -344,6 +349,10 @@
   // instruction in LLVM instead once it works well enough.  
   llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty);
   
+  // GetVLASize - Returns an LLVM value that corresponds to the size in bytes
+  // of a variable length array type.
+  llvm::Value *GetVLASize(const VariableArrayType *);
+
   //===--------------------------------------------------------------------===//
   //                            Declaration Emission
   //===--------------------------------------------------------------------===//