When possible, use the vbase offset offsets from the most derived class directly.
llvm-svn: 98247
This commit is contained in:
parent
3521552ebe
commit
e4424888e4
|
@ -1406,9 +1406,16 @@ VtableBuilder::ComputeReturnAdjustment(BaseOffset Offset) {
|
||||||
if (!Offset.isEmpty()) {
|
if (!Offset.isEmpty()) {
|
||||||
if (Offset.VirtualBase) {
|
if (Offset.VirtualBase) {
|
||||||
// Get the virtual base offset offset.
|
// Get the virtual base offset offset.
|
||||||
Adjustment.VBaseOffsetOffset =
|
if (Offset.DerivedClass == MostDerivedClass) {
|
||||||
VtableInfo.getVirtualBaseOffsetIndex(Offset.DerivedClass,
|
// We can get the offset offset directly from our map.
|
||||||
Offset.VirtualBase);
|
Adjustment.VBaseOffsetOffset =
|
||||||
|
VBaseOffsetOffsets.lookup(Offset.VirtualBase);
|
||||||
|
} else {
|
||||||
|
Adjustment.VBaseOffsetOffset =
|
||||||
|
VtableInfo.getVirtualBaseOffsetIndex(Offset.DerivedClass,
|
||||||
|
Offset.VirtualBase);
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: Once the assert in getVirtualBaseOffsetIndex is back again,
|
// FIXME: Once the assert in getVirtualBaseOffsetIndex is back again,
|
||||||
// we can get rid of this assert.
|
// we can get rid of this assert.
|
||||||
assert(Adjustment.VBaseOffsetOffset != 0 &&
|
assert(Adjustment.VBaseOffsetOffset != 0 &&
|
||||||
|
|
Loading…
Reference in New Issue