Index: lib/Analysis/MemRegion.cpp
===================================================================
--- lib/Analysis/MemRegion.cpp	(revision 89760)
+++ lib/Analysis/MemRegion.cpp	(working copy)
@@ -457,7 +457,7 @@
           break;
         }
 
-        int64_t size = (int64_t) (C.getTypeSize(elemType) / 8);
+        int64_t size = (int64_t) (C.getTypeSizeInBytes(elemType));
         offset += (i * size);
       }
 
Index: lib/Analysis/CallAndMessageChecker.cpp
===================================================================
--- lib/Analysis/CallAndMessageChecker.cpp	(revision 89760)
+++ lib/Analysis/CallAndMessageChecker.cpp	(working copy)
@@ -192,9 +192,9 @@
         if (RetTy != Ctx.VoidTy) {
           if (C.getPredecessor()->getParentMap().isConsumedExpr(ME)) {
             // sizeof(void *)
-            const uint64_t voidPtrSize = Ctx.getTypeSize(Ctx.VoidPtrTy);
+            const uint64_t voidPtrSize = Ctx.getTypeSizeInBytes(Ctx.VoidPtrTy);
             // sizeof(return type)
-            const uint64_t returnTypeSize = Ctx.getTypeSize(ME->getType());
+            const uint64_t returnTypeSize = Ctx.getTypeSizeInBytes(ME->getType());
             
             if (voidPtrSize < returnTypeSize) {
               if (ExplodedNode* N = C.GenerateSink(StNull)) {
@@ -206,7 +206,7 @@
                       "results in the returned value (of type '"
                        << ME->getType().getAsString()
                        << "' and of size "
-                       << returnTypeSize / 8
+                       << returnTypeSize
                        << " bytes) to be garbage or otherwise undefined";
                     BT_void_ptr = new BuiltinBug(os.str().c_str());
                   }
Index: lib/Analysis/Store.cpp
===================================================================
--- lib/Analysis/Store.cpp	(revision 89760)
+++ lib/Analysis/Store.cpp	(working copy)
@@ -163,7 +163,7 @@
       // We can only compute sizeof(PointeeTy) if it is a complete type.
       if (IsCompleteType(Ctx, PointeeTy)) {
         // Compute the size in **bytes**.
-        int64_t pointeeTySize = (int64_t) (Ctx.getTypeSize(PointeeTy) / 8);
+        int64_t pointeeTySize = (int64_t) (Ctx.getTypeSizeInBytes(PointeeTy));
 
         // Is the offset a multiple of the size?  If so, we can layer the
         // ElementRegion (with elementType == PointeeTy) directly on top of
Index: lib/Analysis/GRExprEngine.cpp
===================================================================
--- lib/Analysis/GRExprEngine.cpp	(revision 89760)
+++ lib/Analysis/GRExprEngine.cpp	(working copy)
@@ -2163,7 +2163,7 @@
     }
     else {
       // All other cases.
-      amt = getContext().getTypeSize(T) / 8;
+      amt = getContext().getTypeSizeInBytes(T);
     }
   }
   else  // Get alignment of the type.
Index: lib/CodeGen/CGException.cpp
===================================================================
--- lib/CodeGen/CGException.cpp	(revision 89760)
+++ lib/CodeGen/CGException.cpp	(working copy)
@@ -95,7 +95,7 @@
   
   // Now allocate the exception object.
   const llvm::Type *SizeTy = ConvertType(getContext().getSizeType());
-  uint64_t TypeSize = getContext().getTypeSize(ThrowType) / 8;
+  uint64_t TypeSize = getContext().getTypeSizeInBytes(ThrowType);
   
   llvm::Constant *AllocExceptionFn = getAllocateExceptionFn(*this);
   llvm::Value *ExceptionPtr = 
Index: lib/CodeGen/CodeGenFunction.cpp
===================================================================
--- lib/CodeGen/CodeGenFunction.cpp	(revision 89760)
+++ lib/CodeGen/CodeGenFunction.cpp	(working copy)
@@ -544,7 +544,8 @@
         ElemSize = EmitVLASize(ElemTy);
       else
         ElemSize = llvm::ConstantInt::get(SizeTy,
-                                          getContext().getTypeSize(ElemTy) / 8);
+                                          getContext()
+                                              .getTypeSizeInBytes(ElemTy));
 
       llvm::Value *NumElements = EmitScalarExpr(VAT->getSizeExpr());
       NumElements = Builder.CreateIntCast(NumElements, SizeTy, false, "tmp");
Index: lib/CodeGen/CGExprScalar.cpp
===================================================================
--- lib/CodeGen/CGExprScalar.cpp	(revision 89760)
+++ lib/CodeGen/CGExprScalar.cpp	(working copy)
@@ -1014,7 +1014,7 @@
       if (const ObjCInterfaceType *OIT =
           dyn_cast<ObjCInterfaceType>(PTEE)) {
         // Handle interface types, which are not represented with a concrete type.
-        int size = CGF.getContext().getTypeSize(OIT) / 8;
+        int size = CGF.getContext().getTypeSizeInBytes(OIT);
         if (!isInc)
           size = -size;
         Inc = llvm::ConstantInt::get(Inc->getType(), size);
@@ -1384,7 +1384,7 @@
   if (const ObjCInterfaceType *OIT = dyn_cast<ObjCInterfaceType>(ElementType)) {
     llvm::Value *InterfaceSize =
       llvm::ConstantInt::get(Idx->getType(),
-                             CGF.getContext().getTypeSize(OIT) / 8);
+                             CGF.getContext().getTypeSizeInBytes(OIT));
     Idx = Builder.CreateMul(Idx, InterfaceSize);
     const llvm::Type *i8Ty = llvm::Type::getInt8PtrTy(VMContext);
     Value *Casted = Builder.CreateBitCast(Ptr, i8Ty);
@@ -1448,7 +1448,7 @@
         dyn_cast<ObjCInterfaceType>(LHSElementType)) {
       llvm::Value *InterfaceSize =
         llvm::ConstantInt::get(Idx->getType(),
-                               CGF.getContext().getTypeSize(OIT) / 8);
+                               CGF.getContext().getTypeSizeInBytes(OIT));
       Idx = Builder.CreateMul(Idx, InterfaceSize);
       const llvm::Type *i8Ty = llvm::Type::getInt8PtrTy(VMContext);
       Value *LHSCasted = Builder.CreateBitCast(Ops.LHS, i8Ty);
@@ -1479,7 +1479,7 @@
     if (LHSElementType->isVoidType() || LHSElementType->isFunctionType()) {
       ElementSize = 1;
     } else {
-      ElementSize = CGF.getContext().getTypeSize(LHSElementType) / 8;
+      ElementSize = CGF.getContext().getTypeSizeInBytes(LHSElementType);
     }
 
     const llvm::Type *ResultType = ConvertType(Ops.Ty);
Index: lib/CodeGen/CGExpr.cpp
===================================================================
--- lib/CodeGen/CGExpr.cpp	(revision 89760)
+++ lib/CodeGen/CGExpr.cpp	(working copy)
@@ -1027,7 +1027,7 @@
 
     QualType BaseType = getContext().getBaseElementType(VAT);
 
-    uint64_t BaseTypeSize = getContext().getTypeSize(BaseType) / 8;
+    uint64_t BaseTypeSize = getContext().getTypeSizeInBytes(BaseType);
     Idx = Builder.CreateUDiv(Idx,
                              llvm::ConstantInt::get(Idx->getType(),
                                                     BaseTypeSize));
@@ -1036,7 +1036,7 @@
              dyn_cast<ObjCInterfaceType>(E->getType())) {
     llvm::Value *InterfaceSize =
       llvm::ConstantInt::get(Idx->getType(),
-                             getContext().getTypeSize(OIT) / 8);
+                             getContext().getTypeSizeInBytes(OIT));
 
     Idx = Builder.CreateMul(Idx, InterfaceSize);
 
Index: lib/CodeGen/CGExprCXX.cpp
===================================================================
--- lib/CodeGen/CGExprCXX.cpp	(revision 89760)
+++ lib/CodeGen/CGExprCXX.cpp	(working copy)
@@ -44,7 +44,7 @@
                                         const CXXNewExpr *E,
                                         llvm::Value *& NumElements) {
   QualType Type = E->getAllocatedType();
-  uint64_t TypeSizeInBytes = CGF.getContext().getTypeSize(Type) / 8;
+  uint64_t TypeSizeInBytes = CGF.getContext().getTypeSizeInBytes(Type);
   const llvm::Type *SizeTy = CGF.ConvertType(CGF.getContext().getSizeType());
   
   if (!E->isArray())
@@ -200,7 +200,7 @@
 
   if (uint64_t CookiePadding = CalculateCookiePadding(getContext(), E)) {
     uint64_t CookieOffset = 
-      CookiePadding - getContext().getTypeSize(SizeTy) / 8;
+      CookiePadding - getContext().getTypeSizeInBytes(SizeTy);
     
     llvm::Value *NumElementsPtr = 
       Builder.CreateConstInBoundsGEP1_64(NewPtr, CookieOffset);
@@ -249,7 +249,7 @@
 
   if (DeleteFTy->getNumArgs() == 2) {
     QualType SizeTy = DeleteFTy->getArgType(1);
-    uint64_t SizeVal = getContext().getTypeSize(DeleteTy) / 8;
+    uint64_t SizeVal = getContext().getTypeSizeInBytes(DeleteTy);
     llvm::Constant *Size = llvm::ConstantInt::get(ConvertType(SizeTy),
                                                   SizeVal);
     DeleteArgs.push_back(std::make_pair(RValue::get(Size), SizeTy));
@@ -305,7 +305,7 @@
             llvm::Type *Ptr8Ty = 
               llvm::PointerType::get(llvm::Type::getInt8Ty(VMContext), 0);
             uint64_t CookieOffset =
-              CookiePadding - getContext().getTypeSize(SizeTy) / 8;
+              CookiePadding - getContext().getTypeSizeInBytes(SizeTy);
             llvm::Value *AllocatedObjectPtr = 
               Builder.CreateConstInBoundsGEP1_64(
                             Builder.CreateBitCast(Ptr, Ptr8Ty), -CookiePadding);
Index: lib/CodeGen/CGBlocks.cpp
===================================================================
--- lib/CodeGen/CGBlocks.cpp	(revision 89760)
+++ lib/CodeGen/CGBlocks.cpp	(working copy)
@@ -810,11 +810,11 @@
 uint64_t BlockFunction::getBlockOffset(const BlockDeclRefExpr *BDRE) {
   const ValueDecl *D = dyn_cast<ValueDecl>(BDRE->getDecl());
 
-  uint64_t Size = getContext().getTypeSize(D->getType()) / 8;
+  uint64_t Size = getContext().getTypeSizeInBytes(D->getType());
   uint64_t Align = getContext().getDeclAlignInBytes(D);
 
   if (BDRE->isByRef()) {
-    Size = getContext().getTypeSize(getContext().VoidPtrTy) / 8;
+    Size = getContext().getTypeSizeInBytes(getContext().VoidPtrTy);
     Align = getContext().getTypeAlign(getContext().VoidPtrTy) / 8;
   }
 
Index: lib/Sema/SemaChecking.cpp
===================================================================
--- lib/Sema/SemaChecking.cpp	(revision 89760)
+++ lib/Sema/SemaChecking.cpp	(working copy)
@@ -318,7 +318,7 @@
 
   // Determine the index of the size.
   unsigned SizeIndex;
-  switch (Context.getTypeSize(ValType)/8) {
+  switch (Context.getTypeSizeInBytes(ValType)) {
   case 1: SizeIndex = 0; break;
   case 2: SizeIndex = 1; break;
   case 4: SizeIndex = 2; break;
Index: lib/AST/ExprConstant.cpp
===================================================================
--- lib/AST/ExprConstant.cpp	(revision 89760)
+++ lib/AST/ExprConstant.cpp	(working copy)
@@ -333,7 +333,7 @@
   if (!EvaluateInteger(E->getIdx(), Index, Info))
     return APValue();
 
-  uint64_t ElementSize = Info.Ctx.getTypeSize(E->getType()) / 8;
+  uint64_t ElementSize = Info.Ctx.getTypeSizeInBytes(E->getType());
 
   uint64_t Offset = Index.getSExtValue() * ElementSize;
   Result.setLValue(Result.getLValueBase(),
@@ -424,7 +424,7 @@
   if (PointeeType->isVoidType() || PointeeType->isFunctionType())
     SizeOfPointee = 1;
   else
-    SizeOfPointee = Info.Ctx.getTypeSize(PointeeType) / 8;
+    SizeOfPointee = Info.Ctx.getTypeSizeInBytes(PointeeType);
 
   uint64_t Offset = ResultLValue.getLValueOffset();
 
@@ -959,7 +959,7 @@
                 && VD->getType()->isObjectType()
                 && !VD->getType()->isVariablyModifiedType()
                 && !VD->getType()->isDependentType()) {
-              uint64_t Size = Info.Ctx.getTypeSize(VD->getType()) / 8;
+              uint64_t Size = Info.Ctx.getTypeSizeInBytes(VD->getType());
               uint64_t Offset = Base.Val.getLValueOffset();
               if (Offset <= Size)
                 Size -= Base.Val.getLValueOffset();
@@ -1156,7 +1156,7 @@
 
         uint64_t D = LHSValue.getLValueOffset() - RHSValue.getLValueOffset();
         if (!ElementType->isVoidType() && !ElementType->isFunctionType())
-          D /= Info.Ctx.getTypeSize(ElementType) / 8;
+          D /= Info.Ctx.getTypeSizeInBytes(ElementType);
 
         return Success(D, E);
       }
@@ -1318,8 +1318,7 @@
     return false;
 
   // Get information about the size.
-  unsigned BitWidth = Info.Ctx.getTypeSize(SrcTy);
-  return Success(BitWidth / Info.Ctx.Target.getCharWidth(), E);
+  return Success(Info.Ctx.getTypeSizeInBytes(SrcTy), E);
 }
 
 bool IntExprEvaluator::VisitUnaryOperator(const UnaryOperator *E) {
Index: lib/AST/ASTContext.cpp
===================================================================
--- lib/AST/ASTContext.cpp	(revision 89760)
+++ lib/AST/ASTContext.cpp	(working copy)
@@ -3085,15 +3085,15 @@
 /// getObjCEncodingTypeSize returns size of type for objective-c encoding
 /// purpose.
 int ASTContext::getObjCEncodingTypeSize(QualType type) {
-  uint64_t sz = getTypeSize(type);
+  uint64_t sz = getTypeSizeInBytes(type);
 
   // Make all integer and enum types at least as large as an int
   if (sz > 0 && type->isIntegralType())
-    sz = std::max(sz, getTypeSize(IntTy));
+    sz = std::max(sz, getTypeSizeInBytes(IntTy));
   // Treat arrays as pointers, since that's how they're passed in.
   else if (type->isArrayType())
-    sz = getTypeSize(VoidPtrTy);
-  return sz / getTypeSize(CharTy);
+    sz = getTypeSizeInBytes(VoidPtrTy);
+  return sz;
 }
 
 /// getObjCEncodingForBlockDecl - Return the encoded type for this method
@@ -3109,7 +3109,7 @@
   // Start with computing size of a pointer in number of bytes.
   // FIXME: There might(should) be a better way of doing this computation!
   SourceLocation Loc;
-  int PtrSize = getTypeSize(VoidPtrTy) / getTypeSize(CharTy);
+  int PtrSize = getTypeSizeInBytes(VoidPtrTy);
   int ParmOffset = PtrSize;
   for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(),
        E = Decl->param_end(); PI != E; ++PI) {
@@ -3157,7 +3157,7 @@
   // Start with computing size of a pointer in number of bytes.
   // FIXME: There might(should) be a better way of doing this computation!
   SourceLocation Loc;
-  int PtrSize = getTypeSize(VoidPtrTy) / getTypeSize(CharTy);
+  int PtrSize = getTypeSizeInBytes(VoidPtrTy);
   // The first two arguments (self and _cmd) are pointers; account for
   // their size.
   int ParmOffset = 2 * PtrSize;
