diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-04 03:06:03 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-04 03:06:03 +0000 |
commit | 2fce216955f754d661e2d86cf2778dbad2db2f0a (patch) | |
tree | 0be339c38579b5d4e35ce28a6dc57643fd39cebf /lib/CodeGen/CGVtable.cpp | |
parent | 1e2180bf322f537468f3d94d2ee731cffd994b0a (diff) |
Add the method directly to the vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index bb22ebc037..7ee19ebf39 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -857,25 +857,30 @@ void VtableBuilder::AppendMethodsToVtable() { VirtualAdjustment); } + llvm::Constant *Method = 0; if (!ReturnAdjustment.isEmpty()) { // Build a covariant thunk. CovariantThunkAdjustment Adjustment(ThisAdjustment, ReturnAdjustment); - submethods[i] = CGM.BuildCovariantThunk(MD, Extern, Adjustment); + Method = CGM.BuildCovariantThunk(MD, Extern, Adjustment); } else if (!ThisAdjustment.isEmpty()) { // Build a "regular" thunk. - submethods[i] = CGM.BuildThunk(GD, Extern, ThisAdjustment); + Method = CGM.BuildThunk(GD, Extern, ThisAdjustment); } else if (MD->isPure()) { // We have a pure virtual method. - submethods[i] = getPureVirtualFn(); + Method = getPureVirtualFn(); + } else { + // We have a good old regular method. + Method = WrapAddrOf(GD); } + + // Add the method to the vtable. + methods.push_back(Method); } + ThisAdjustments.clear(); BaseReturnTypes.clear(); - D1(printf("============= combining methods\n")); - methods.insert(methods.end(), submethods.begin(), submethods.end()); - Methods.clear(); submethods.clear(); } |