aboutsummaryrefslogtreecommitdiffstats
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
commit284ee75f26273806def66b94a9c04bb76857179f (patch)
treec45d921bcb8002d180acf85745c8e15b97f55089
parentc6d417d5e9a5e3c51fdbb05d7baf4fb30eddb0fb (diff)
downloadexternal_llvm-284ee75f26273806def66b94a9c04bb76857179f.zip
external_llvm-284ee75f26273806def66b94a9c04bb76857179f.tar.gz
external_llvm-284ee75f26273806def66b94a9c04bb76857179f.tar.bz2
For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
in such cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58505 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Type.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index be21194..14f09f0 100644
--- a/lib/VMCore/Type.cpp
+++ b/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;
}