summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-12-12 07:19:02 +0000
committerAnders Carlsson <andersca@mac.com>2008-12-12 07:19:02 +0000
commitccbe9200f9f3ec2062a235f7377024db50cbb2f9 (patch)
tree934e637b2b7c8082f906b07017c977add727704b /clang/lib/CodeGen/CodeGenFunction.h
parentdcba4a7713035fc6bf3dc5703147e693a1ff3c14 (diff)
downloadbcm5719-llvm-ccbe9200f9f3ec2062a235f7377024db50cbb2f9.tar.gz
bcm5719-llvm-ccbe9200f9f3ec2062a235f7377024db50cbb2f9.zip
Add map of VLA types and their sizes
llvm-svn: 60939
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 952c3b3c1c7..5c4246f7c31 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -166,6 +166,11 @@ private:
/// 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 @@ public:
// 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
//===--------------------------------------------------------------------===//
OpenPOWER on IntegriCloud