diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-04 02:43:50 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-04 02:43:50 +0000 |
commit | b73ba39f389bd80eac4a35c867604600b0098f53 (patch) | |
tree | 8ff92d97157063998879b22a94f9c45b528d17f1 /lib/CodeGen/CGVtable.cpp | |
parent | b17daf9ab790ae71aacad2cc4aa11cd8d86c25d1 (diff) |
Move 'this' pointer adjustment thunks to AppendMethods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 92c49112c0..aa1b248a55 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -331,21 +331,6 @@ public: } BaseReturnTypes.clear(); - for (ThisAdjustmentsMapTy::const_iterator i = ThisAdjustments.begin(), - e = ThisAdjustments.end(); i != e; ++i) { - uint64_t Index = i->first; - GlobalDecl GD = Methods[Index]; - const ThunkAdjustment &ThisAdjustment = i->second; - - const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl()); - assert(!MD->isPure() && "Can't thunk pure virtual methods!"); - - assert(Index == VtableBuilder::Index[GD] && "Thunk index mismatch!"); - - submethods[Index] = CGM.BuildThunk(GD, Extern, ThisAdjustment); - } - ThisAdjustments.clear(); - for (PureVirtualMethodsSetTy::iterator i = PureVirtualMethods.begin(), e = PureVirtualMethods.end(); i != e; ++i) { GlobalDecl GD = *i; @@ -907,6 +892,19 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m, void VtableBuilder::AppendMethods() { InstallThunks(); + + for (unsigned i = 0, e = Methods.size(); i != e; ++i) { + GlobalDecl GD = Methods[i]; + + ThunkAdjustment ThisAdjustment = ThisAdjustments.lookup(i); + + if (!ThisAdjustment.isEmpty()) + submethods[i] = CGM.BuildThunk(GD, Extern, ThisAdjustment); + } + + ThisAdjustments.clear(); + + D1(printf("============= combining methods\n")); methods.insert(methods.end(), submethods.begin(), submethods.end()); |