From: Ken Dyck Date: Fri, 22 Apr 2011 17:59:22 +0000 (+0000) Subject: Replace a couple of literal 8s with ASTContext::getCharWidth(). No change in X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0afc892e75f526f7ecce7dd152d946337632efe;p=clang Replace a couple of literal 8s with ASTContext::getCharWidth(). No change in functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130002 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index e6ebf7c097..365f311f2a 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -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();