From a84b4044b79f2cc424c6ae7ee5edb97e948ba806 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Fri, 20 Nov 2009 00:02:19 +0000 Subject: Fixup key function calculations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89412 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 195acc5bc1..1fbd3b9273 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -623,7 +623,9 @@ void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { const CGRecordLayout &CGLayout = Types.getCGRecordLayout(RD); // A definition of a KeyFunction, generates all the class data, such // as vtable, rtti and the VTT. - if (CGLayout.getKeyFunction() == MD) + if (CGLayout.getKeyFunction() + && (CGLayout.getKeyFunction()->getCanonicalDecl() + == MD->getCanonicalDecl())) getVtableInfo().GenerateClassData(RD); } if (const CXXConstructorDecl *CD = dyn_cast(D)) -- cgit v1.2.3-18-g5258