aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-04 02:08:24 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-04 02:08:24 +0000
commita7f1911db2ec8c203f6d9ccf3206e0ba1738433e (patch)
tree2d60461305758d2a6a36365eb485d9b5ef044213 /lib/CodeGen/CGVtable.cpp
parentd02e83a548359df978f40cc1a52ffd78b7ef371b (diff)
Start populating the VtableMembers structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index 46a0bab035..b8860841ab 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -421,7 +421,10 @@ public:
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 @@ public:
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 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m,
Adjustment.GD = GD;
}
+ Methods.OverrideMethod(OGD, GD);
+
Index[GD] = i;
submethods[i] = m;
if (isPure)