From b95d1ff43726ff8a2fd5845fb4f3685a0daec58e Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Fri, 3 Feb 2012 17:28:51 +0000 Subject: [PATCH] Simplify some GEP checks in the verifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149698 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Verifier.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 642930352f4..066c2e76d6c 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1315,11 +1315,9 @@ void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) { } void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) { - Type *TargetTy = GEP.getPointerOperandType(); - if (VectorType *VTy = dyn_cast(TargetTy)) - TargetTy = VTy->getElementType(); + Type *TargetTy = GEP.getPointerOperandType()->getScalarType(); - Assert1(dyn_cast(TargetTy), + Assert1(isa(TargetTy), "GEP base pointer is not a vector or a vector of pointers", &GEP); Assert1(cast(TargetTy)->getElementType()->isSized(), "GEP into unsized type!", &GEP);