[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h

Chris Lattner lattner at cs.uiuc.edu
Sun Apr 4 20:26:02 PDT 2004


Changes in directory llvm/include/llvm:

DerivedTypes.h updated: 1.55 -> 1.56

---
Log message:

Be more restrictive with the index types we allow for sequential types


---
Diffs of the changes:  (+10 -1)

Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.55 llvm/include/llvm/DerivedTypes.h:1.56
--- llvm/include/llvm/DerivedTypes.h:1.55	Mon Feb 16 20:58:36 2004
+++ llvm/include/llvm/DerivedTypes.h	Sun Apr  4 20:25:21 2004
@@ -263,7 +263,16 @@
     return ContainedTys[0];
   }
   virtual bool indexValid(const Value *V) const {
-    return V->getType()->isInteger();
+    const Type *Ty = V->getType();
+    switch (Ty->getPrimitiveID()) {
+    case Type::IntTyID:
+    case Type::UIntTyID:
+    case Type::LongTyID:
+    case Type::ULongTyID:
+      return true;
+    default:
+      return false;
+    }
   }
 
   // Methods for support type inquiry through isa, cast, and dyn_cast:





More information about the llvm-commits mailing list