Replace calls to getTypeSize() and getTypeAlign() with their 'InChars'
counterparts where char units are needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123805 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index fde9f03..0a19245 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -1245,10 +1245,10 @@
if (const ObjCObjectType *OIT = PTEE->getAs<ObjCObjectType>()) {
// Handle interface types, which are not represented with a concrete
// type.
- int size = CGF.getContext().getTypeSize(OIT) / 8;
+ CharUnits size = CGF.getContext().getTypeSizeInChars(OIT);
if (!isInc)
size = -size;
- Inc = llvm::ConstantInt::get(Inc->getType(), size);
+ Inc = llvm::ConstantInt::get(Inc->getType(), size.getQuantity());
const llvm::Type *i8Ty = llvm::Type::getInt8PtrTy(VMContext);
InVal = Builder.CreateBitCast(InVal, i8Ty);
NextVal = Builder.CreateGEP(InVal, Inc, "add.ptr");