aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXX.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-03-23 04:31:31 +0000
committerAnders Carlsson <andersca@mac.com>2010-03-23 04:31:31 +0000
commit7270ee4cd4794281c09dfb6931a98bbb2581ef02 (patch)
treed67f34e79c87627d61a48d2ac015fd06fe2a4a1b /lib/CodeGen/CGCXX.cpp
parent13189d0a184cac98b00ad7d7ee93481633af46cc (diff)
Always emit associated thunks when emitting the function itself. Remove getVtableAddressPoint, it's not used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99252 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r--lib/CodeGen/CGCXX.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp
index f788f62f6f..3895e75b8e 100644
--- a/lib/CodeGen/CGCXX.cpp
+++ b/lib/CodeGen/CGCXX.cpp
@@ -489,11 +489,17 @@ CodeGenModule::GetAddrOfCovariantThunk(GlobalDecl GD,
}
void CodeGenModule::BuildThunksForVirtual(GlobalDecl GD) {
+ const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
+
+ if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD))
+ GD = GlobalDecl(DD, GD.getDtorType());
+ else
+ GD = MD->getCanonicalDecl();
+
CodeGenVTables::AdjustmentVectorTy *AdjPtr = getVTables().getAdjustments(GD);
if (!AdjPtr)
return;
CodeGenVTables::AdjustmentVectorTy &Adj = *AdjPtr;
- const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
for (unsigned i = 0; i < Adj.size(); i++) {
GlobalDecl OGD = Adj[i].first;
const CXXMethodDecl *OMD = cast<CXXMethodDecl>(OGD.getDecl());