Fixup key function calculations.

llvm-svn: 89412
This commit is contained in:
Mike Stump
2009-11-20 00:02:19 +00:00
parent 772f922acb
commit a7a1b7e780
4 changed files with 58 additions and 59 deletions

View File

@@ -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<CXXConstructorDecl>(D))