For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
[oota-llvm.git] / lib / VMCore / Type.cpp
index be211949799ebfd0b6b342344bb9a6e0a7cef93e..14f09f045675556fe4901345e1c0b03a1c4b8272 100644 (file)
@@ -1516,7 +1516,8 @@ void PointerType::typeBecameConcrete(const DerivedType *AbsTy) {
 
 bool SequentialType::indexValid(const Value *V) const {
   if (const IntegerType *IT = dyn_cast<IntegerType>(V->getType())) 
-    return IT->getBitWidth() == 32 || IT->getBitWidth() == 64;
+    return IT->getBitWidth() == 16 ||
+           IT->getBitWidth() == 32 || IT->getBitWidth() == 64;
   return false;
 }