[cfe-commits] r130002 - /cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Ken Dyck
kd at kendyck.com
Fri Apr 22 10:59:22 PDT 2011
Author: kjdyck
Date: Fri Apr 22 12:59:22 2011
New Revision: 130002
URL: http://llvm.org/viewvc/llvm-project?rev=130002&view=rev
Log:
Replace a couple of literal 8s with ASTContext::getCharWidth(). No change in
functionality intended.
Modified:
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=130002&r1=130001&r2=130002&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Fri Apr 22 12:59:22 2011
@@ -1330,8 +1330,10 @@
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 @@
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();
More information about the cfe-commits
mailing list