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

Anders Carlsson andersca at mac.com
Thu Dec 3 18:08:24 PST 2009


Author: andersca
Date: Thu Dec  3 20:08:24 2009
New Revision: 90517

URL: http://llvm.org/viewvc/llvm-project?rev=90517&view=rev
Log:
Start populating the VtableMembers structure.

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=90517&r1=90516&r2=90517&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Thu Dec  3 20:08:24 2009
@@ -421,7 +421,10 @@
 
     const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
     
-    // else allocate a new slot.
+    // We didn't find an entry in the vtable that we could use, add a new
+    // entry.
+    Methods.AddMethod(GD);
+
     Index[GD] = submethods.size();
     submethods.push_back(m);
     D1(printf("  vfn for %s at %d\n", MD->getNameAsString().c_str(),
@@ -553,9 +556,13 @@
     methods.push_back(rtti);
     Index_t AddressPoint = methods.size();
 
+    assert(submethods.size() == Methods.size() && "Method size mismatch!");
+
     InstallThunks();
     D1(printf("============= combining methods\n"));
     methods.insert(methods.end(), submethods.begin(), submethods.end());
+    
+    Methods.clear();
     submethods.clear();
 
     // and then the non-virtual bases.
@@ -864,6 +871,8 @@
         Adjustment.GD = GD;
       }
 
+      Methods.OverrideMethod(OGD, GD);
+
       Index[GD] = i;
       submethods[i] = m;
       if (isPure)





More information about the cfe-commits mailing list