[llvm-commits] CVS: llvm-gcc/gcc/llvm-representation.c

Chris Lattner lattner at cs.uiuc.edu
Fri May 7 13:33:03 PDT 2004


Changes in directory llvm-gcc/gcc:

llvm-representation.c updated: 1.7 -> 1.8

---
Log message:

Relax restrictions on gep operand types


---
Diffs of the changes:  (+5 -2)

Index: llvm-gcc/gcc/llvm-representation.c
diff -u llvm-gcc/gcc/llvm-representation.c:1.7 llvm-gcc/gcc/llvm-representation.c:1.8
--- llvm-gcc/gcc/llvm-representation.c:1.7	Fri May  7 11:55:49 2004
+++ llvm-gcc/gcc/llvm-representation.c	Fri May  7 13:32:35 2004
@@ -590,8 +590,11 @@
   llvm_type *ResultTy = GET_POINTER_TYPE_ELEMENT(Op0->Ty);
   assert(Op1->Ty == LongTy && "First GEP index must be long type!");
   assert(llvm_type_is_composite(ResultTy) && "Cannot index into noncomposite!");
-  assert(((ResultTy->ID == ArrayTyID && Op2->Ty == LongTy) ||
-          (ResultTy->ID == StructTyID && Op2->Ty == UByteTy)) &&
+  assert(((ResultTy->ID == ArrayTyID &&
+           (Op2->Ty == LongTy || Op2->Ty == ULongTy ||
+            Op2->Ty == IntTy || Op2->Ty == UIntTy)) ||
+          (ResultTy->ID == StructTyID &&
+           (Op2->Ty == UByteTy || Op2->Ty == UIntTy))) &&
          "Invalid getelementptr indices!");
   if (ResultTy->ID == StructTyID) {
     unsigned Idx = llvm_constant_get_integer_val(V2C(Op2));





More information about the llvm-commits mailing list