[cfe-commits] r90525 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Anders Carlsson
andersca at mac.com
Thu Dec 3 18:39:04 PST 2009
Author: andersca
Date: Thu Dec 3 20:39:04 2009
New Revision: 90525
URL: http://llvm.org/viewvc/llvm-project?rev=90525&view=rev
Log:
Factor appending methods to a vtable out into a separate function.
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=90525&r1=90524&r2=90525&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Thu Dec 3 20:39:04 2009
@@ -288,6 +288,9 @@
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 @@
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 @@
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:
More information about the cfe-commits
mailing list