summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-12-06 22:01:30 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-12-06 22:01:30 +0000
commit8174f2c23ce005c53b0ac2885cb2e967de1aafbb (patch)
tree8942c29b371b4bdeabaeba090ba4fa53bb6df729 /clang/lib/CodeGen/CodeGenModule.cpp
parent94bb5e8d7556183f3634496c8fc4ee58f2b99e3d (diff)
downloadbcm5719-llvm-8174f2c23ce005c53b0ac2885cb2e967de1aafbb.tar.gz
bcm5719-llvm-8174f2c23ce005c53b0ac2885cb2e967de1aafbb.zip
Work-in-progess rewrite of thunks: move thunk generation outside of vtable
generation, and make sure we generate thunks when the function is defined rather than when the vtable is defined. llvm-svn: 90722
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 8fb03b2d19c..5f822f509f8 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -621,8 +621,13 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) {
Context.getSourceManager(),
"Generating code for declaration");
- if (isa<CXXMethodDecl>(D))
+ if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
getVtableInfo().MaybeEmitVtable(GD);
+ if (MD->isVirtual() && MD->isOutOfLine() &&
+ (!isa<CXXDestructorDecl>(D) || GD.getDtorType() != Dtor_Base)) {
+ BuildThunksForVirtual(GD);
+ }
+ }
if (const CXXConstructorDecl *CD = dyn_cast<CXXConstructorDecl>(D))
EmitCXXConstructor(CD, GD.getCtorType());
OpenPOWER on IntegriCloud