[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Dec 15 15:13:31 PST 2004
Changes in directory llvm/lib/Target/CBackend:
Writer.cpp updated: 1.215 -> 1.216
---
Log message:
Fix PR485: http://llvm.cs.uiuc.edu/PR485 , instead of emitting zero sized arrays, emit arrays of size 1.
---
Diffs of the changes: (+1 -0)
Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.215 llvm/lib/Target/CBackend/Writer.cpp:1.216
--- llvm/lib/Target/CBackend/Writer.cpp:1.215 Mon Dec 13 15:52:52 2004
+++ llvm/lib/Target/CBackend/Writer.cpp Wed Dec 15 17:13:15 2004
@@ -338,6 +338,7 @@
case Type::ArrayTyID: {
const ArrayType *ATy = cast<ArrayType>(Ty);
unsigned NumElements = ATy->getNumElements();
+ if (NumElements == 0) NumElements = 1;
return printType(Out, ATy->getElementType(),
NameSoFar + "[" + utostr(NumElements) + "]");
}
More information about the llvm-commits
mailing list