forked from OSchip/llvm-project
Use pointer size function where only a pointer is expected
llvm-svn: 207023
This commit is contained in:
parent
e226b08ee9
commit
4dbd4891c7
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue