summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-04-05 01:25:21 +0000
committerChris Lattner <sabre@nondot.org>2004-04-05 01:25:21 +0000
commit60cf133a8e963f235736fc64110f4784e55e1b0c (patch)
tree37d640b516d2d03ae463b19548454003fc412be0
parente916f16dbb0cd47384c3e46f6fd81f2dc7962802 (diff)
downloadbcm5719-llvm-60cf133a8e963f235736fc64110f4784e55e1b0c.tar.gz
bcm5719-llvm-60cf133a8e963f235736fc64110f4784e55e1b0c.zip
Be more restrictive with the index types we allow for sequential types
llvm-svn: 12650
-rw-r--r--llvm/include/llvm/DerivedTypes.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/include/llvm/DerivedTypes.h b/llvm/include/llvm/DerivedTypes.h
index b53ecd276d0..ffa9551b8da 100644
--- a/llvm/include/llvm/DerivedTypes.h
+++ b/llvm/include/llvm/DerivedTypes.h
@@ -263,7 +263,16 @@ public:
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:
OpenPOWER on IntegriCloud