aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-02-03 17:28:51 +0000
committerDuncan Sands <baldrick@free.fr>2012-02-03 17:28:51 +0000
commitb95d1ff43726ff8a2fd5845fb4f3685a0daec58e (patch)
treebf86841ff2cc2721a30b86de2aada5fe52e02977
parent7e413e9c94294f17daa64ac9fda09a738e20caa5 (diff)
Simplify some GEP checks in the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149698 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Verifier.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 642930352f..066c2e76d6 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<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);