diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-05 01:25:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-05 01:25:21 +0000 |
commit | 60cf133a8e963f235736fc64110f4784e55e1b0c (patch) | |
tree | 37d640b516d2d03ae463b19548454003fc412be0 | |
parent | e916f16dbb0cd47384c3e46f6fd81f2dc7962802 (diff) | |
download | bcm5719-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.h | 11 |
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: |