diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-29 02:53:58 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-29 02:53:58 +0000 |
commit | acfa6ae66e8b8bb83edc13e1e560fd14ad72f783 (patch) | |
tree | ec0e2e8ad6ce47c891ac885d38b08b6ff1847910 /lib/CodeGen/CGVtable.cpp | |
parent | 851853d8b71f5bf2f24705c8dc2df54b2af88d71 (diff) |
Only add thunks for the most derived class. This fixes some link errors I was seeing in files generated by the vtable tester utility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99801 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 3322510815..f44b7ccb18 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -1803,8 +1803,9 @@ VtableBuilder::AddMethods(BaseSubobject Base, uint64_t BaseOffsetInLayoutClass, ComputeThisAdjustment(OverriddenMD, BaseOffsetInLayoutClass, Overrider); - if (ThisAdjustment.VCallOffsetOffset) { - // This is a virtual thunk, add it. + if (ThisAdjustment.VCallOffsetOffset && + Overrider.Method->getParent() == MostDerivedClass) { + // This is a virtual thunk for the most derived class, add it. AddThunk(Overrider.Method, ThunkInfo(ThisAdjustment, ReturnAdjustment())); } |