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

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

lib/CodeGen/CGObjCMac.cpp

index bd80caff86913ac858a13107a4f48953b0b274be..e8b6f7f5433e050aef103ae680ce1e8404bb34c7 100644 (file)
@@ -3562,7 +3562,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI,
       // Note that 'i' here is actually the field index inside RD of Field,
       // although this dependency is hidden.
       const ASTRecordLayout &RL = CGM.getContext().getASTRecordLayout(RD);
-      FieldOffset = RL.getFieldOffset(i) / 8;
+      FieldOffset = RL.getFieldOffset(i) / ByteSizeInBits;
     } else
       FieldOffset = ComputeIvarBaseOffset(CGM, OI, cast<ObjCIvarDecl>(Field));
 
@@ -4868,7 +4868,7 @@ void CGObjCNonFragileABIMac::GetClassSizeInfo(const ObjCImplementationDecl *OID,
   if (!RL.getFieldCount())
     InstanceStart = InstanceSize;
   else
-    InstanceStart = RL.getFieldOffset(0) / 8;
+    InstanceStart = RL.getFieldOffset(0) / CGM.getContext().getCharWidth();
 }
 
 void CGObjCNonFragileABIMac::GenerateClass(const ObjCImplementationDecl *ID) {