summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2008-10-31 10:26:20 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2008-10-31 10:26:20 +0000
commite3ba47b71be3a80d4e374e205af73ea7ec2a6477 (patch)
tree25281fc17f4dec7ca10fe14a4fdaeec6f4616bff
parent98bb1fa69ee32bfdfd8690a6e65c8a72f4077853 (diff)
downloadbcm5719-llvm-e3ba47b71be3a80d4e374e205af73ea7ec2a6477.tar.gz
bcm5719-llvm-e3ba47b71be3a80d4e374e205af73ea7ec2a6477.zip
For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
in such cases. llvm-svn: 58505
-rw-r--r--llvm/lib/VMCore/Type.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index be211949799..14f09f04567 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -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;
}
OpenPOWER on IntegriCloud