Use pointer size function where only a pointer is expected
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 23 Apr 2014 21:10:15 +0000 (21:10 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 23 Apr 2014 21:10:15 +0000 (21:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207023 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DataLayout.cpp

index 7c3bc3df6d1a642a4ef9f32a9a4ee243fb35f5fc..dea05fbef4ab426756b06805a643078341c6124c 100644 (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());