[cfe-commits] r72585 - in /cfe/trunk: lib/CodeGen/CodeGenFunction.cpp test/CodeGen/vla.c
Eli Friedman
eli.friedman at gmail.com
Fri May 29 12:23:46 PDT 2009
Author: efriedma
Date: Fri May 29 14:23:46 2009
New Revision: 72585
URL: http://llvm.org/viewvc/llvm-project?rev=72585&view=rev
Log:
Re-add a slightly more general version of the check from r72578; it is
actually necessary in some obscure cases.
Modified:
cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
cfe/trunk/test/CodeGen/vla.c
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=72585&r1=72584&r2=72585&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Fri May 29 14:23:46 2009
@@ -487,6 +487,8 @@
}
return SizeEntry;
+ } else if (const ArrayType *AT = dyn_cast<ArrayType>(Ty)) {
+ EmitVLASize(AT->getElementType());
} else if (const PointerType *PT = Ty->getAsPointerType())
EmitVLASize(PT->getPointeeType());
else {
Modified: cfe/trunk/test/CodeGen/vla.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/vla.c?rev=72585&r1=72584&r2=72585&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/vla.c (original)
+++ cfe/trunk/test/CodeGen/vla.c Fri May 29 14:23:46 2009
@@ -29,3 +29,9 @@
if (a[0] != 3) {
}
}
+
+void g(int count) {
+ // Make sure we emit sizes correctly in some obscure cases
+ int (*a[5])[count];
+ int (*b)[][count];
+}
More information about the cfe-commits
mailing list