]> granicus.if.org Git - clang/commitdiff
Replace some literal 8s with char width and char align. No change in
authorKen Dyck <kd@kendyck.com>
Fri, 22 Apr 2011 17:23:43 +0000 (17:23 +0000)
committerKen Dyck <kd@kendyck.com>
Fri, 22 Apr 2011 17:23:43 +0000 (17:23 +0000)
functionality intended.

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

lib/CodeGen/CGObjCRuntime.cpp

index 5859f2a23632b2d47333a42e5bb3e163373467fc..3d854d41acbe89e21f13ba781cf5806f750863cb 100644 (file)
@@ -117,8 +117,8 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
     CGF.CGM.getContext().getASTObjCInterfaceLayout(OID);
   uint64_t TypeSizeInBits = CGF.CGM.getContext().toBits(RL.getSize());
   uint64_t FieldBitOffset = LookupFieldBitOffset(CGF.CGM, OID, 0, Ivar);
-  uint64_t BitOffset = FieldBitOffset % 8;
-  uint64_t ContainingTypeAlign = 8;
+  uint64_t BitOffset = FieldBitOffset % CGF.CGM.getContext().getCharWidth();
+  uint64_t ContainingTypeAlign = CGF.CGM.getContext().Target.getCharAlign();
   uint64_t ContainingTypeSize = TypeSizeInBits - (FieldBitOffset - BitOffset);
   uint64_t BitFieldSize =
     Ivar->getBitWidth()->EvaluateAsInt(CGF.getContext()).getZExtValue();