forked from OSchip/llvm-project
Be more restrictive with the index types we allow for sequential types
llvm-svn: 12650
This commit is contained in:
parent
e916f16dbb
commit
60cf133a8e
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue