[llvm-commits] CVS: llvm-gcc/gcc/llvm-types.c
Chris Lattner
lattner at cs.uiuc.edu
Fri Aug 6 10:44:59 PDT 2004
Changes in directory llvm-gcc/gcc:
llvm-types.c updated: 1.11 -> 1.12
---
Log message:
Increase fixed size buffers.
"Noone would ever want a struct with more than 1024 elements in it".
This is obviously a gross hack
---
Diffs of the changes: (+8 -5)
Index: llvm-gcc/gcc/llvm-types.c
diff -u llvm-gcc/gcc/llvm-types.c:1.11 llvm-gcc/gcc/llvm-types.c:1.12
--- llvm-gcc/gcc/llvm-types.c:1.11 Sun Jul 18 16:18:03 2004
+++ llvm-gcc/gcc/llvm-types.c Fri Aug 6 12:44:47 2004
@@ -1204,9 +1204,9 @@
unsigned Idx, Size;
unsigned fieldcount;
PtrPtrTableEntry **HTEP, *HTE;
- llvm_type *StructElements[256]; /* FIXME: Fixed size buffers are bad. */
- unsigned ElementOffsets[256];
- unsigned ElementAlignments[256];
+ llvm_type *StructElements[256*4]; /* FIXME: Fixed size buffers are bad. */
+ unsigned ElementOffsets[256*4];
+ unsigned ElementAlignments[256*4];
/* Is it a forward declaration? */
if (TYPE_SIZE(type) == 0) { /* Yes, handle this. */
@@ -1288,7 +1288,7 @@
if (Field && TREE_CODE(Field) != FIELD_DECL)
Field = GetNextFieldDecl(Field);
for (fieldcount = 0; Field; fieldcount++,Field = GetNextFieldDecl(Field)) {
- assert ((fieldcount<256) && "LLVM can only have 255 structure members!");
+ assert ((fieldcount<256*4) && "LLVM can only have 1023 structure members!");
DecodeFieldDecl(Field, StructElements, ElementOffsets, ElementAlignments,
&Idx, &Size);
@@ -1363,8 +1363,11 @@
return (HTE->Dest = llvm_type_get_cannonical_struct(Result));
}
case VOID_TYPE: return VoidTy;
- case BOOLEAN_TYPE: return BoolTy;
+ case BOOLEAN_TYPE:
+ if (TYPE_PRECISION(type) == 1)
+ return BoolTy;
+ /* FALL THROUGH */
case ENUMERAL_TYPE:
if (TYPE_SIZE(type) == 0) {
/* Use of an enum that is only forward declared. */
More information about the llvm-commits
mailing list