Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' 
counterparts where char units are needed.

llvm-svn: 123805
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index 0837c57..1c64e3c 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -241,9 +241,10 @@
                                     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 @@
     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 =