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

Anders Carlsson andersca at mac.com
Sun Jan 17 09:10:45 PST 2010


Author: andersca
Date: Sun Jan 17 11:10:44 2010
New Revision: 93681

URL: http://llvm.org/viewvc/llvm-project?rev=93681&view=rev
Log:
Get the ctor vtable address points directly from the VTT builder.

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=93681&r1=93680&r2=93681&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sun Jan 17 11:10:44 2010
@@ -1266,9 +1266,19 @@
                                  const CXXRecordDecl *VtableClass,
                                  const CXXRecordDecl *RD,
                                  uint64_t Offset) {
-    int64_t AddressPoint = 
-      (*AddressPoints[VtableClass])[std::make_pair(RD, Offset)];
+    uint64_t AddressPoint;
     
+    if (VtableClass != Class) {
+      // We have a ctor vtable, look for the address point in the ctor vtable
+      // address points.
+      AddressPoint = 
+        CtorVtableAddressPoints[std::make_pair(VtableClass, 
+                                               BaseSubobject(RD, Offset))];
+    } else { 
+      AddressPoint = 
+        (*AddressPoints[VtableClass])[std::make_pair(RD, Offset)];
+    }
+
     // FIXME: We can never have 0 address point.  Do this for now so gepping
     // retains the same structure.  Later we'll just assert.
     if (AddressPoint == 0)





More information about the cfe-commits mailing list