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 | 68056127bb76a28713f829d92b309c2b1960ffc2 (patch) | |
tree | 883899f28b27d61f0449a71375a5a80235ac1160 /include | |
parent | 89c60480008ee9b9826cb0a655fc3a4dee8be83f (diff) | |
download | llvm-68056127bb76a28713f829d92b309c2b1960ffc2.tar.gz llvm-68056127bb76a28713f829d92b309c2b1960ffc2.tar.bz2 llvm-68056127bb76a28713f829d92b309c2b1960ffc2.tar.xz |
Be more restrictive with the index types we allow for sequential types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12650 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/DerivedTypes.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index b53ecd276d..ffa9551b8d 100644 --- a/include/llvm/DerivedTypes.h +++ b/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: |