More work on vcall offsets. We now emit the right number of vcall offsets in my local test case, but not the right values.
llvm-svn: 96874
This commit is contained in:
parent
8ad777dc75
commit
30f5301e54
|
@ -1106,7 +1106,7 @@ VtableBuilder::AddVCallAndVBaseOffsets(BaseSubobject Base,
|
||||||
int64_t OffsetToTop = -(int64_t)Base.getBaseOffset() / 8;
|
int64_t OffsetToTop = -(int64_t)Base.getBaseOffset() / 8;
|
||||||
AddVBaseOffsets(Base.getBase(), OffsetToTop, VBases);
|
AddVBaseOffsets(Base.getBase(), OffsetToTop, VBases);
|
||||||
|
|
||||||
// We only want to add vcall offsets for virtual bases in secondary vtables.
|
// We only want to add vcall offsets for virtual bases.
|
||||||
if (BaseIsVirtual && OffsetToTop != 0)
|
if (BaseIsVirtual && OffsetToTop != 0)
|
||||||
AddVCallOffsets(Base);
|
AddVCallOffsets(Base);
|
||||||
}
|
}
|
||||||
|
@ -1183,10 +1183,6 @@ void VtableBuilder::AddVCallOffsets(BaseSubobject Base) {
|
||||||
const CXXRecordDecl *BaseDecl =
|
const CXXRecordDecl *BaseDecl =
|
||||||
cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl());
|
cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl());
|
||||||
|
|
||||||
// Ignore the primary base.
|
|
||||||
if (BaseDecl == PrimaryBase)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Get the base offset of this base.
|
// Get the base offset of this base.
|
||||||
uint64_t BaseOffset = Base.getBaseOffset() +
|
uint64_t BaseOffset = Base.getBaseOffset() +
|
||||||
Layout.getBaseClassOffset(BaseDecl);
|
Layout.getBaseClassOffset(BaseDecl);
|
||||||
|
|
Loading…
Reference in New Issue