[cfe-commits] r129491 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Ken Dyck kd at kendyck.com
Wed Apr 13 17:43:09 PDT 2011


Author: kjdyck
Date: Wed Apr 13 19:43:09 2011
New Revision: 129491

URL: http://llvm.org/viewvc/llvm-project?rev=129491&view=rev
Log:
Replace a couple of divisions-by-'8' with divisions-by-charwidth. No change
in functionality intended.

Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=129491&r1=129490&r2=129491&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Wed Apr 13 19:43:09 2011
@@ -3562,7 +3562,7 @@
       // 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 @@
   if (!RL.getFieldCount())
     InstanceStart = InstanceSize;
   else
-    InstanceStart = RL.getFieldOffset(0) / 8;
+    InstanceStart = RL.getFieldOffset(0) / CGM.getContext().getCharWidth();
 }
 
 void CGObjCNonFragileABIMac::GenerateClass(const ObjCImplementationDecl *ID) {





More information about the cfe-commits mailing list