forked from OSchip/llvm-project
Convert local offset variable to CharUnits in AddVCallOffsets. No change in
functionality intended. llvm-svn: 128522
This commit is contained in:
parent
078f3e6905
commit
075de167f8
|
@ -876,7 +876,7 @@ void VCallAndVBaseOffsetBuilder::AddVCallOffsets(BaseSubobject Base,
|
||||||
if (!VCallOffsets.AddVCallOffset(MD, OffsetOffset))
|
if (!VCallOffsets.AddVCallOffset(MD, OffsetOffset))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int64_t Offset = 0;
|
CharUnits Offset = CharUnits::Zero();
|
||||||
|
|
||||||
if (Overriders) {
|
if (Overriders) {
|
||||||
// Get the final overrider.
|
// 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
|
/// The vcall offset is the offset from the virtual base to the object
|
||||||
/// where the function was overridden.
|
/// where the function was overridden.
|
||||||
// FIXME: We should not use / 8 here.
|
Offset = Overrider.Offset - Context.toCharUnitsFromBits(VBaseOffset);
|
||||||
Offset = (int64_t)(Context.toBits(Overrider.Offset) - VBaseOffset) / 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Components.push_back(VTableComponent::MakeVCallOffset(Offset));
|
Components.push_back(
|
||||||
|
VTableComponent::MakeVCallOffset(Offset.getQuantity()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// And iterate over all non-virtual bases (ignoring the primary base).
|
// And iterate over all non-virtual bases (ignoring the primary base).
|
||||||
|
|
Loading…
Reference in New Issue