[cfe-commits] r99801 - /cfe/trunk/lib/CodeGen/CGVtable.cpp

Anders Carlsson andersca at mac.com
Sun Mar 28 19:53:58 PDT 2010


Author: andersca
Date: Sun Mar 28 21:53:58 2010
New Revision: 99801

URL: http://llvm.org/viewvc/llvm-project?rev=99801&view=rev
Log:
Only add thunks for the most derived class. This fixes some link errors I was seeing in files generated by the vtable tester utility.

Modified:
    cfe/trunk/lib/CodeGen/CGVtable.cpp

Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=99801&r1=99800&r2=99801&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sun Mar 28 21:53:58 2010
@@ -1803,8 +1803,9 @@
             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()));
           }





More information about the cfe-commits mailing list