forked from OSchip/llvm-project
Refine the non-virtual this adjustments for thunks by using the offset
to the declaring class from the nearest virtual base class. WIP. llvm-svn: 94606
This commit is contained in:
parent
3ba6da49f5
commit
ded0a406b4
|
@ -1114,6 +1114,12 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, bool MorallyVirtual,
|
||||||
(int)VCalls[idx-1], MostDerivedClass->getNameAsCString()));
|
(int)VCalls[idx-1], MostDerivedClass->getNameAsCString()));
|
||||||
}
|
}
|
||||||
int64_t NonVirtualAdjustment = -VCallOffset[OGD];
|
int64_t NonVirtualAdjustment = -VCallOffset[OGD];
|
||||||
|
QualType DerivedType = MD->getThisType(CGM.getContext());
|
||||||
|
QualType BaseType = cast<const CXXMethodDecl>(OGD.getDecl())->getThisType(CGM.getContext());
|
||||||
|
int64_t NonVirtualAdjustment2 = -(getNVOffset(BaseType, DerivedType)/8);
|
||||||
|
if (NonVirtualAdjustment2 != NonVirtualAdjustment) {
|
||||||
|
NonVirtualAdjustment = NonVirtualAdjustment2;
|
||||||
|
}
|
||||||
int64_t VirtualAdjustment =
|
int64_t VirtualAdjustment =
|
||||||
-((idx + extra + 2) * LLVMPointerWidth / 8);
|
-((idx + extra + 2) * LLVMPointerWidth / 8);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue