summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjCMac.cpp
diff options
context:
space:
mode:
authorKen Dyck <kd@kendyck.com>2011-02-11 01:54:29 +0000
committerKen Dyck <kd@kendyck.com>2011-02-11 01:54:29 +0000
commitb0fcc59e19508dca2dc809fb5c83e19c4d3e9ffc (patch)
tree50f55aa851f434ae67dabbb02ed0ac6c21b5f2fe /clang/lib/CodeGen/CGObjCMac.cpp
parenta759d72d7b00328077328306dae142c9c97a57e2 (diff)
downloadbcm5719-llvm-b0fcc59e19508dca2dc809fb5c83e19c4d3e9ffc.tar.gz
bcm5719-llvm-b0fcc59e19508dca2dc809fb5c83e19c4d3e9ffc.zip
Add a helper function, ASTContext::toBits(), that converts sizes in
CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. llvm-svn: 125332
Diffstat (limited to 'clang/lib/CodeGen/CGObjCMac.cpp')
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 3cbb296b0b2..83672f8b10f 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -131,8 +131,7 @@ LValue CGObjCRuntime::EmitValueForIvarAtOffset(CodeGen::CodeGenFunction &CGF,
// a synthesized ivar can never be a bit-field, so this is safe.
const ASTRecordLayout &RL =
CGF.CGM.getContext().getASTObjCInterfaceLayout(OID);
- uint64_t TypeSizeInBits =
- RL.getSize().getQuantity() * CGF.CGM.getContext().getCharWidth();
+ 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;
OpenPOWER on IntegriCloud