diff options
| author | Mike Stump <mrs@apple.com> | 2010-01-26 22:44:01 +0000 |
|---|---|---|
| committer | Mike Stump <mrs@apple.com> | 2010-01-26 22:44:01 +0000 |
| commit | ded0a406b421595196729082387ba11814835fe2 (patch) | |
| tree | f0070335422665147623b8d6443f47898aa87d9e /clang/lib | |
| parent | 3ba6da49f55809cc2ee88ecdcafa34b456b09343 (diff) | |
| download | bcm5719-llvm-ded0a406b421595196729082387ba11814835fe2.tar.gz bcm5719-llvm-ded0a406b421595196729082387ba11814835fe2.zip | |
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
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGVtable.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index cb3f1816d8a..b6bb385fe94 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/lib/CodeGen/CGVtable.cpp @@ -1114,6 +1114,12 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, bool MorallyVirtual, (int)VCalls[idx-1], MostDerivedClass->getNameAsCString())); } 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 = -((idx + extra + 2) * LLVMPointerWidth / 8); |

