Undo r258163 "Move part of an if condition into an assertion. NFC."

This undoes the change made in r258163.  The assertion fails if `Ptr` is of a
vector type.  The previous code doesn't look completely correct either, so I'll
investigate this more.

llvm-svn: 258411
This commit is contained in:
Manuel Jacob 2016-01-21 17:36:14 +00:00
parent 82e0f15f86
commit f3ee254bc2
1 changed files with 2 additions and 2 deletions

View File

@ -731,8 +731,8 @@ static Constant *SymbolicallyEvaluateGEP(Type *SrcTy, ArrayRef<Constant *> Ops,
Type *ResultTy, const DataLayout &DL,
const TargetLibraryInfo *TLI) {
Constant *Ptr = Ops[0];
assert(Ptr->getType()->isPointerTy());
if (!Ptr->getType()->getPointerElementType()->isSized())
if (!Ptr->getType()->getPointerElementType()->isSized() ||
!Ptr->getType()->isPointerTy())
return nullptr;
Type *IntPtrTy = DL.getIntPtrType(Ptr->getType());