]> granicus.if.org Git - clang/commitdiff
Get the ctor vtable address points directly from the VTT builder.
authorAnders Carlsson <andersca@mac.com>
Sun, 17 Jan 2010 17:10:44 +0000 (17:10 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 17 Jan 2010 17:10:44 +0000 (17:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93681 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index ae900d6ae70e6c868487da7dac3d298008caa1a7..27cb6612928e8246c7260b6165fcfbe8bfed9f63 100644 (file)
@@ -1266,9 +1266,19 @@ class VTTBuilder {
                                  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)