aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-03-22 15:47:01 +0000
committerAnders Carlsson <andersca@mac.com>2010-03-22 15:47:01 +0000
commit253942158cd75fc9061e384aeba589cc8bb5f0c5 (patch)
tree5c7f352db091608cd6e5d2369de066494a7237e0 /lib/CodeGen/CGVtable.cpp
parent24f7e36800af169c42ae73338ca72f76dc695f14 (diff)
We want to add all thunks, not just 'this' adjustment thunks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index d11cbb4b80..04326b6e7c 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -1423,12 +1423,35 @@ void VtableBuilder::ComputeThisAdjustments() {
// Add an adjustment for the deleting destructor as well.
Thunks[VtableIndex + 1].This = ThisAdjustment;
}
-
- AddThunk(Overrider.Method, Thunks[VtableIndex]);
}
/// Clear the method info map.
MethodInfoMap.clear();
+
+ if (isBuildingConstructorVtable()) {
+ // We don't need to store thunk information for construction vtables.
+ return;
+ }
+
+ for (ThunksInfoMapTy::const_iterator I = Thunks.begin(), E = Thunks.end();
+ I != E; ++I) {
+ const VtableComponent &Component = Components[I->first];
+ const ThunkInfo &Thunk = I->second;
+
+ switch (Component.getKind()) {
+ default:
+ llvm_unreachable("Unexpected vtable component kind!");
+ case VtableComponent::CK_FunctionPointer:
+ AddThunk(Component.getFunctionDecl(), Thunk);
+ break;
+ case VtableComponent::CK_CompleteDtorPointer:
+ AddThunk(Component.getDestructorDecl(), Thunk);
+ break;
+ case VtableComponent::CK_DeletingDtorPointer:
+ // We've already added the thunk when we saw the complete dtor pointer.
+ break;
+ }
+ }
}
VtableBuilder::ReturnAdjustment