]> granicus.if.org Git - clang/commitdiff
Only add thunks for the most derived class. This fixes some link errors I was seeing...
authorAnders Carlsson <andersca@mac.com>
Mon, 29 Mar 2010 02:53:58 +0000 (02:53 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 29 Mar 2010 02:53:58 +0000 (02:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99801 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index 33225108152049ad6b9fe528b92a8f045c006872..f44b7ccb189d6b5b54c2fac7f8c60f42e7fbe390 100644 (file)
@@ -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()));
           }