aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorKen Dyck <kd@kendyck.com>2011-01-19 01:58:38 +0000
committerKen Dyck <kd@kendyck.com>2011-01-19 01:58:38 +0000
commitfe71008c2764768f25478b16c1802755189ed7c9 (patch)
tree54b4b86c30e456a0ab8bf588a28d762dee47ea6f /lib/CodeGen/CGExprScalar.cpp
parent69fc1b330090853ced40436805258fc9a0a70bdc (diff)
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
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--lib/CodeGen/CGExprScalar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index fde9f03ba7..0a192457a4 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -1245,10 +1245,10 @@ EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
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");