diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-12-06 22:01:30 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-12-06 22:01:30 +0000 |
commit | 8174f2c23ce005c53b0ac2885cb2e967de1aafbb (patch) | |
tree | 8942c29b371b4bdeabaeba090ba4fa53bb6df729 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 94bb5e8d7556183f3634496c8fc4ee58f2b99e3d (diff) | |
download | bcm5719-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.cpp | 7 |
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()); |