[llvm-commits] [llvm] r149698 - /llvm/trunk/lib/VMCore/Verifier.cpp

Duncan Sands baldrick at free.fr
Fri Feb 3 09:28:51 PST 2012


Author: baldrick
Date: Fri Feb  3 11:28:51 2012
New Revision: 149698

URL: http://llvm.org/viewvc/llvm-project?rev=149698&view=rev
Log:
Simplify some GEP checks in the verifier.

Modified:
    llvm/trunk/lib/VMCore/Verifier.cpp

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=149698&r1=149697&r2=149698&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Feb  3 11:28:51 2012
@@ -1315,11 +1315,9 @@
 }
 
 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);





More information about the llvm-commits mailing list