summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
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
commit495634e5ac146410bf9fef6df59e521cedbfd3bb (patch)
tree1d03e2d6b7394537a5d2bc730531bea2e8abf406 /clang/lib/CodeGen
parent4c837d258ffab04df6b896b1f4f8f0c440a12088 (diff)
downloadbcm5719-llvm-495634e5ac146410bf9fef6df59e521cedbfd3bb.tar.gz
bcm5719-llvm-495634e5ac146410bf9fef6df59e521cedbfd3bb.zip
Factor appending methods to a vtable out into a separate function.
llvm-svn: 90525
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGVtable.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp
index c8d4a736839..92c49112c0b 100644
--- a/clang/lib/CodeGen/CGVtable.cpp
+++ b/clang/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:
OpenPOWER on IntegriCloud