]> granicus.if.org Git - clang/commitdiff
Replace a couple of literal 8s with ASTContext::getCharWidth(). No change in
authorKen Dyck <kd@kendyck.com>
Fri, 22 Apr 2011 17:59:22 +0000 (17:59 +0000)
committerKen Dyck <kd@kendyck.com>
Fri, 22 Apr 2011 17:59:22 +0000 (17:59 +0000)
functionality intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130002 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCGNU.cpp

index e6ebf7c097978b3a5c32365ffe2cc1a3bb3ea3f2..365f311f2aa9adc4d6ce54554226fc809cabf954 100644 (file)
@@ -1330,8 +1330,10 @@ llvm::Constant *CGObjCGNU::GenerateClassStructure(
   Elements.push_back(llvm::ConstantInt::get(LongTy, info));
   if (isMeta) {
     llvm::TargetData td(&TheModule);
-    Elements.push_back(llvm::ConstantInt::get(LongTy,
-                     td.getTypeSizeInBits(ClassTy)/8));
+    Elements.push_back(
+        llvm::ConstantInt::get(LongTy,
+                               td.getTypeSizeInBits(ClassTy) /
+                                 CGM.getContext().getCharWidth()));
   } else
     Elements.push_back(InstanceSize);
   Elements.push_back(IVars);
@@ -2137,8 +2139,10 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
   Elements.push_back(llvm::ConstantInt::get(LongTy, RuntimeVersion));
   // sizeof(ModuleTy)
   llvm::TargetData td(&TheModule);
-  Elements.push_back(llvm::ConstantInt::get(LongTy,
-                     td.getTypeSizeInBits(ModuleTy)/8));
+  Elements.push_back(
+    llvm::ConstantInt::get(LongTy,
+                           td.getTypeSizeInBits(ModuleTy) /
+                             CGM.getContext().getCharWidth()));
 
   // The path to the source file where this module was declared
   SourceManager &SM = CGM.getContext().getSourceManager();