Use type helper functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault
2013-09-27 22:18:51 +00:00
parent 5972df2696
commit b060a46b0d
3 changed files with 4 additions and 6 deletions

View File

@ -313,8 +313,7 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
}
// Don't attempt to analyze GEPs over unsized objects.
if (!cast<PointerType>(GEPOp->getOperand(0)->getType())
->getElementType()->isSized())
if (!GEPOp->getOperand(0)->getType()->getPointerElementType()->isSized())
return V;
// If we are lacking DataLayout information, we can't compute the offets of
@ -354,7 +353,7 @@ DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
// If the integer type is smaller than the pointer size, it is implicitly
// sign extended to pointer size.
unsigned Width = cast<IntegerType>(Index->getType())->getBitWidth();
unsigned Width = Index->getType()->getIntegerBitWidth();
if (TD->getPointerSizeInBits() > Width)
Extension = EK_SignExt;