aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-04 02:39:04 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-04 02:39:04 +0000
commitadfa26773c0157cc1ce92213ed6e9c76fa570677 (patch)
tree5dfd2f7d42cc7c58f1a2d816b9d2acd37619c8a4
parent98fdb2468797d920adf60fcafb5060e76aed3324 (diff)
Factor appending methods to a vtable out into a separate function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90525 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGVtable.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index c8d4a73683..92c49112c0 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -288,6 +288,9 @@ public:
bool MorallyVirtual, Index_t OverrideOffset,
Index_t Offset, int64_t CurrentVBaseOffset);
+ /// AppendMethods - Append the current methods to the vtable.
+ void AppendMethods();
+
void InstallThunks() {
for (BaseReturnTypesMapTy::const_iterator i = BaseReturnTypes.begin(),
e = BaseReturnTypes.end(); i != e; ++i) {
@@ -537,12 +540,7 @@ public:
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();
+ AppendMethods();
// and then the non-virtual bases.
NonVirtualBases(RD, Layout, PrimaryBase, PrimaryBaseWasVirtual,
@@ -907,6 +905,15 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m,
return false;
}
+void VtableBuilder::AppendMethods() {
+ InstallThunks();
+ D1(printf("============= combining methods\n"));
+ methods.insert(methods.end(), submethods.begin(), submethods.end());
+
+ Methods.clear();
+ submethods.clear();
+}
+
void CGVtableInfo::ComputeMethodVtableIndices(const CXXRecordDecl *RD) {
// Itanium C++ ABI 2.5.2: