[llvm-commits] CVS: gcc-3.4/gcc/llvm-types.c

John Criswell criswell at cs.uiuc.edu
Wed Mar 10 13:39:05 PST 2004


Changes in directory gcc-3.4/gcc:

llvm-types.c updated: 1.1 -> 1.2

---
Log message:

Adjusted static arrays so that they can handle the maximum size structure
that the LLVM assembly representation can handle.
Added code that will assert() that a structure is compilable with LLVM.
This should hopefull fix PR#281.



---
Diffs of the changes:  (+6 -4)

Index: gcc-3.4/gcc/llvm-types.c
diff -u gcc-3.4/gcc/llvm-types.c:1.1 gcc-3.4/gcc/llvm-types.c:1.2
--- gcc-3.4/gcc/llvm-types.c:1.1	Thu Jan  8 16:35:32 2004
+++ gcc-3.4/gcc/llvm-types.c	Wed Mar 10 13:38:33 2004
@@ -1185,10 +1185,11 @@
     tree BaseTypes = TYPE_BINFO(type) ? BINFO_BASETYPES(TYPE_BINFO(type)) : 0;
     tree Field = TYPE_FIELDS(type);
     unsigned Idx, Size;
+    unsigned fieldcount;
     PtrPtrTableEntry **HTEP, *HTE;
-    llvm_type *StructElements[200];  /* FIXME: Fixed size buffers are bad. */
-    unsigned ElementOffsets[200];
-    unsigned ElementAlignments[200];
+    llvm_type *StructElements[256];  /* FIXME: Fixed size buffers are bad. */
+    unsigned ElementOffsets[256];
+    unsigned ElementAlignments[256];
 
     /* Is it a forward declaration? */
     if (TYPE_SIZE(type) == 0) { /* Yes, handle this. */
@@ -1269,7 +1270,8 @@
     /* Process all of the fields. */
     if (Field && TREE_CODE(Field) != FIELD_DECL)
       Field = GetNextFieldDecl(Field);
-    for (; Field; Field = GetNextFieldDecl(Field)) {
+    for (fieldcount = 0; Field; fieldcount++,Field = GetNextFieldDecl(Field)) {
+      assert ((fieldcount<256) && "LLVM can only have 255 structure members!");
       DecodeFieldDecl(Field, StructElements, ElementOffsets, ElementAlignments,
                       &Idx, &Size);
 





More information about the llvm-commits mailing list