Use pointer size function where only a pointer is expected

llvm-svn: 207023
This commit is contained in:
Matt Arsenault 2014-04-23 21:10:15 +00:00
parent e226b08ee9
commit 4dbd4891c7
1 changed files with 1 additions and 1 deletions

View File

@ -708,7 +708,7 @@ IntegerType *DataLayout::getIntPtrType(LLVMContext &C,
Type *DataLayout::getIntPtrType(Type *Ty) const {
assert(Ty->isPtrOrPtrVectorTy() &&
"Expected a pointer or pointer vector type.");
unsigned NumBits = getTypeSizeInBits(Ty->getScalarType());
unsigned NumBits = getPointerTypeSizeInBits(Ty);
IntegerType *IntTy = IntegerType::get(Ty->getContext(), NumBits);
if (VectorType *VecTy = dyn_cast<VectorType>(Ty))
return VectorType::get(IntTy, VecTy->getNumElements());