From 0afe9672b582978bfa4849e073dfb1a2c81fb819 Mon Sep 17 00:00:00 2001 From: Ken Dyck Date: Thu, 14 Apr 2011 01:00:39 +0000 Subject: [PATCH] Replace a couple of divide-by-8s with divide-by-charwidths. No change in functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129496 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGObjCRuntime.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/CGObjCRuntime.cpp b/lib/CodeGen/CGObjCRuntime.cpp index 49b1ce12bc..5859f2a236 100644 --- a/lib/CodeGen/CGObjCRuntime.cpp +++ b/lib/CodeGen/CGObjCRuntime.cpp @@ -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, -- 2.40.0