From 705ba07ef08ac8221385e97caa9d8732a7a94bf3 Mon Sep 17 00:00:00 2001 From: Ken Dyck Date: Wed, 19 Jan 2011 01:58:38 +0000 Subject: Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' counterparts where char units are needed. llvm-svn: 123805 --- clang/lib/CodeGen/CGObjC.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGObjC.cpp') diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 0837c578a79..1c64e3cb4c3 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -241,9 +241,10 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP, Types.ConvertType(getContext().VoidPtrTy))); Args.push_back(std::make_pair(RV, getContext().VoidPtrTy)); // sizeof (Type of Ivar) - uint64_t Size = getContext().getTypeSize(Ivar->getType()) / 8; + CharUnits Size = getContext().getTypeSizeInChars(Ivar->getType()); llvm::Value *SizeVal = - llvm::ConstantInt::get(Types.ConvertType(getContext().LongTy), Size); + llvm::ConstantInt::get(Types.ConvertType(getContext().LongTy), + Size.getQuantity()); Args.push_back(std::make_pair(RValue::get(SizeVal), getContext().LongTy)); llvm::Value *isAtomic = @@ -374,9 +375,10 @@ void CodeGenFunction::GenerateObjCSetter(ObjCImplementationDecl *IMP, RV = RValue::get(ArgAsPtrTy); Args.push_back(std::make_pair(RV, getContext().VoidPtrTy)); // sizeof (Type of Ivar) - uint64_t Size = getContext().getTypeSize(Ivar->getType()) / 8; + CharUnits Size = getContext().getTypeSizeInChars(Ivar->getType()); llvm::Value *SizeVal = - llvm::ConstantInt::get(Types.ConvertType(getContext().LongTy), Size); + llvm::ConstantInt::get(Types.ConvertType(getContext().LongTy), + Size.getQuantity()); Args.push_back(std::make_pair(RValue::get(SizeVal), getContext().LongTy)); llvm::Value *True = -- cgit v1.2.3