]> granicus.if.org Git - clang/commitdiff
Replace a couple of divide-by-8s with divide-by-charwidths. No change in
authorKen Dyck <kd@kendyck.com>
Thu, 14 Apr 2011 01:00:39 +0000 (01:00 +0000)
committerKen Dyck <kd@kendyck.com>
Thu, 14 Apr 2011 01:00:39 +0000 (01:00 +0000)
functionality intended.

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

lib/CodeGen/CGObjCRuntime.cpp

index 49b1ce12bc02e4819220ea211f0eb05a82c673cf..5859f2a23632b2d47333a42e5bb3e163373467fc 100644 (file)
@@ -68,13 +68,15 @@ static uint64_t LookupFieldBitOffset(CodeGen::CodeGenModule &CGM,
 uint64_t CGObjCRuntime::ComputeIvarBaseOffset(CodeGen::CodeGenModule &CGM,
                                               const ObjCInterfaceDecl *OID,
                                               const ObjCIvarDecl *Ivar) {
-  return LookupFieldBitOffset(CGM, OID, 0, Ivar) / 8;
+  return LookupFieldBitOffset(CGM, OID, 0, Ivar) / 
+    CGM.getContext().getCharWidth();
 }
 
 uint64_t CGObjCRuntime::ComputeIvarBaseOffset(CodeGen::CodeGenModule &CGM,
                                               const ObjCImplementationDecl *OID,
                                               const ObjCIvarDecl *Ivar) {
-  return LookupFieldBitOffset(CGM, OID->getClassInterface(), OID, Ivar) / 8;
+  return LookupFieldBitOffset(CGM, OID->getClassInterface(), OID, Ivar) / 
+    CGM.getContext().getCharWidth();
 }
 
 LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,