Simplify some GEP checks in the verifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149698 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2012-02-03 17:28:51 +00:00
parent 7e413e9c94
commit b95d1ff437

View File

@ -1315,11 +1315,9 @@ void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) {
}
void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
Type *TargetTy = GEP.getPointerOperandType();
if (VectorType *VTy = dyn_cast<VectorType>(TargetTy))
TargetTy = VTy->getElementType();
Type *TargetTy = GEP.getPointerOperandType()->getScalarType();
Assert1(dyn_cast<PointerType>(TargetTy),
Assert1(isa<PointerType>(TargetTy),
"GEP base pointer is not a vector or a vector of pointers", &GEP);
Assert1(cast<PointerType>(TargetTy)->getElementType()->isSized(),
"GEP into unsized type!", &GEP);