summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-09-24 17:30:16 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-09-24 17:30:16 +0000
commit8fb87aec78b52b6133b4359c24c2407431e8c2a4 (patch)
tree9f6e911138ca10f3d9efaef0f8ff6469daa8b99e /clang/lib/CodeGen/CodeGenFunction.cpp
parentcbb421887de951f0d689415522430fcad3c764fd (diff)
downloadbcm5719-llvm-8fb87aec78b52b6133b4359c24c2407431e8c2a4.tar.gz
bcm5719-llvm-8fb87aec78b52b6133b4359c24c2407431e8c2a4.zip
Patch implements passing arrays to functions expecting
vla. Implements pr7827. llvm-svn: 114737
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index c2016e83863..5e301b5218b 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -625,6 +625,9 @@ llvm::Value *CodeGenFunction::EmitVLASize(QualType Ty) {
EnsureInsertPoint();
if (const VariableArrayType *VAT = getContext().getAsVariableArrayType(Ty)) {
+ // unknown size indication requires no size computation.
+ if (!VAT->getSizeExpr())
+ return 0;
llvm::Value *&SizeEntry = VLASizeMap[VAT->getSizeExpr()];
if (!SizeEntry) {
OpenPOWER on IntegriCloud