MS ABI: Don't try to emit VF/VB-Tables for extern class templates

There will be an explicit template instantiation in another translation
unit which will provide the definition of the VF/VB-Tables.

This fixes PR22932.

llvm-svn: 232680
This commit is contained in:
David Majnemer
2015-03-18 22:04:43 +00:00
parent 2d56abacd1
commit a03849b2e7
6 changed files with 116 additions and 100 deletions

View File

@@ -1851,7 +1851,8 @@ CodeGenModule::CreateOrReplaceCXXRuntimeVariable(StringRef Name,
OldGV->eraseFromParent();
}
if (supportsCOMDAT() && GV->isWeakForLinker())
if (supportsCOMDAT() && GV->isWeakForLinker() &&
!GV->hasAvailableExternallyLinkage())
GV->setComdat(TheModule.getOrInsertComdat(GV->getName()));
return GV;