Fix vbtable indices when a class shares the vbptr with a non-virtual base

llvm-svn: 194082
This commit is contained in:
Timur Iskhodzhanov
2013-11-05 15:54:58 +00:00
parent 41778fd28f
commit 5877663622
13 changed files with 245 additions and 108 deletions

View File

@@ -295,9 +295,9 @@ static llvm::Value *BuildAppleKextVirtualCall(CodeGenFunction &CGF,
Ty = Ty->getPointerTo()->getPointerTo();
VTable = CGF.Builder.CreateBitCast(VTable, Ty);
assert(VTable && "BuildVirtualCall = kext vtbl pointer is null");
uint64_t VTableIndex = CGM.getVTableContext().getMethodVTableIndex(GD);
uint64_t VTableIndex = CGM.getItaniumVTableContext().getMethodVTableIndex(GD);
uint64_t AddressPoint =
CGM.getVTableContext().getVTableLayout(RD)
CGM.getItaniumVTableContext().getVTableLayout(RD)
.getAddressPoint(BaseSubobject(RD, CharUnits::Zero()));
VTableIndex += AddressPoint;
llvm::Value *VFuncPtr =