diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-18 17:32:33 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-18 17:32:33 +0000 |
commit | 8b6765fb563a5b03d128d8f53b9b3986128a3405 (patch) | |
tree | d56f62d9b0deebc31f1f52b9440e121fb3990c20 /lib/CodeGen/CGVtable.cpp | |
parent | 54d9a78b2ca41b89f5dc8ec6688086db59667495 (diff) |
Fix another bug and add another class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 176e9c3037..6ab6a60a92 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -1138,9 +1138,17 @@ void VtableBuilder::AddVCallOffsets(BaseSubobject Base) { const ASTRecordLayout &MostDerivedClassLayout = Context.getASTRecordLayout(MostDerivedClass); - // FIXME: We should not use / 8 here. + FinalOverriders::OverriderInfo Overrider = + Overriders.getOverrider(Base, MD); + Offset = - -(int64_t)MostDerivedClassLayout.getVBaseClassOffset(VBaseDecl) / 8; + -(int64_t)MostDerivedClassLayout.getVBaseClassOffset(VBaseDecl); + + // The base offset should be relative to the final overrider. + Offset += Overrider.BaseOffset; + + // FIXME: We should not use / 8 here. + Offset = Offset / 8; } VCallAndVBaseOffsets.push_back(VtableComponent::MakeVCallOffset(Offset)); |