[cfe-commits] r41423 - /cfe/trunk/CodeGen/CodeGenTypes.cpp
Chris Lattner
sabre at nondot.org
Sat Aug 25 22:02:08 PDT 2007
Author: lattner
Date: Sun Aug 26 00:02:07 2007
New Revision: 41423
URL: http://llvm.org/viewvc/llvm-project?rev=41423&view=rev
Log:
int X[] isn't a VLA. This improves support for stdio.h on darwin.
Modified:
cfe/trunk/CodeGen/CodeGenTypes.cpp
Modified: cfe/trunk/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/CodeGen/CodeGenTypes.cpp?rev=41423&r1=41422&r2=41423&view=diff
==============================================================================
--- cfe/trunk/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenTypes.cpp Sun Aug 26 00:02:07 2007
@@ -90,8 +90,10 @@
"FIXME: We only handle trivial array types so far!");
llvm::APSInt Size(32);
- if (A.getSizeExpr() &&
- A.getSizeExpr()->isIntegerConstantExpr(Size, Context)) {
+ if (A.getSizeExpr() == 0) {
+ // int X[] -> [0 x int]
+ return llvm::ArrayType::get(ConvertType(A.getElementType()), 0);
+ } else if (A.getSizeExpr()->isIntegerConstantExpr(Size, Context)) {
const llvm::Type *EltTy = ConvertType(A.getElementType());
return llvm::ArrayType::get(EltTy, Size.getZExtValue());
} else {
More information about the cfe-commits
mailing list