aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-07 19:45:40 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-07 19:45:40 +0000
commit1851a12605bc6f1ea70d11974a315340ebaab6eb (patch)
treeaa75366648d8cf95699bfef4330be6655e04b438 /lib/CodeGen
parent585fa68ca00421af6c8289866a7bde27a8e8c0ce (diff)
Make sure to set vtable pointers in the destructors as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGClass.cpp2
-rw-r--r--lib/CodeGen/CGException.cpp1
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp2
3 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
index fb2c9583d4..522fee488c 100644
--- a/lib/CodeGen/CGClass.cpp
+++ b/lib/CodeGen/CGClass.cpp
@@ -1043,7 +1043,7 @@ void CodeGenFunction::SynthesizeDefaultDestructor(const CXXDestructorDecl *Dtor,
StartFunction(GlobalDecl(Dtor, DtorType), Dtor->getResultType(), Fn, Args,
SourceLocation());
-
+ InitializeVtablePtrs(Dtor->getParent());
EmitDtorEpilogue(Dtor, DtorType);
FinishFunction();
}
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
index 85db6bb973..60a1016cc0 100644
--- a/lib/CodeGen/CGException.cpp
+++ b/lib/CodeGen/CGException.cpp
@@ -473,6 +473,7 @@ void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) {
llvm::BasicBlock *DtorEpilogue = createBasicBlock("dtor.epilogue");
PushCleanupBlock(DtorEpilogue);
+ InitializeVtablePtrs(DD->getParent());
EmitStmt(S.getTryBlock());
CleanupBlockInfo Info = PopCleanupBlock();
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 44ed9db347..4eeea8eea7 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -283,6 +283,8 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn) {
llvm::BasicBlock *DtorEpilogue = createBasicBlock("dtor.epilogue");
PushCleanupBlock(DtorEpilogue);
+ InitializeVtablePtrs(DD->getParent());
+
EmitStmt(S);
CleanupBlockInfo Info = PopCleanupBlock();