diff options
author | Ken Dyck <kd@kendyck.com> | 2011-03-30 01:21:33 +0000 |
---|---|---|
committer | Ken Dyck <kd@kendyck.com> | 2011-03-30 01:21:33 +0000 |
commit | 0c64b7dcf17338cbeaf491206aad96ca15ae4d24 (patch) | |
tree | be889e8b87e415096d1f601c440979ea709a8b6f /lib/CodeGen/CGVTables.cpp | |
parent | 7262e90a10a65d50350465e831ff3df75d86a454 (diff) |
Convert local offset variable to CharUnits in AddVCallOffsets. No change in
functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | lib/CodeGen/CGVTables.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index ac27ab8c6e..a0d7c4cfc9 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -876,7 +876,7 @@ void VCallAndVBaseOffsetBuilder::AddVCallOffsets(BaseSubobject Base, if (!VCallOffsets.AddVCallOffset(MD, OffsetOffset)) continue; - int64_t Offset = 0; + CharUnits Offset = CharUnits::Zero(); if (Overriders) { // Get the final overrider. @@ -885,11 +885,11 @@ void VCallAndVBaseOffsetBuilder::AddVCallOffsets(BaseSubobject Base, /// The vcall offset is the offset from the virtual base to the object /// where the function was overridden. - // FIXME: We should not use / 8 here. - Offset = (int64_t)(Context.toBits(Overrider.Offset) - VBaseOffset) / 8; + Offset = Overrider.Offset - Context.toCharUnitsFromBits(VBaseOffset); } - Components.push_back(VTableComponent::MakeVCallOffset(Offset)); + Components.push_back( + VTableComponent::MakeVCallOffset(Offset.getQuantity())); } // And iterate over all non-virtual bases (ignoring the primary base). |