From b455f0e74be0144ab9738ef574d07bd661959525 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 7 Dec 2009 23:56:34 +0000 Subject: A bunch more thunk fixes from misc testing. (Yes, I do intend to commit some tests for this.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90818 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 5f822f509f..6250e6952d 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -625,7 +625,13 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { getVtableInfo().MaybeEmitVtable(GD); if (MD->isVirtual() && MD->isOutOfLine() && (!isa(D) || GD.getDtorType() != Dtor_Base)) { - BuildThunksForVirtual(GD); + if (isa(D)) { + GlobalDecl CanonGD(cast(D->getCanonicalDecl()), + GD.getDtorType()); + BuildThunksForVirtual(CanonGD); + } else { + BuildThunksForVirtual(MD->getCanonicalDecl()); + } } } -- cgit v1.2.3-18-g5258