Improve key-function computation for templates. In particular:
- All classes can have a key function; templates don't change that. non-template classes when computing the key function. - We always mark all of the virtual member functions of class template instantiations. - The vtable for an instantiation of a class template has weak linkage. We could probably use available_externally linkage for vtables of classes instantiated by explicit instantiation declarations (extern templates), but GCC doesn't do this and I'm not 100% that the ABI permits it. llvm-svn: 92753
This commit is contained in:
@@ -547,7 +547,8 @@ bool CodeGenModule::MayDeferGeneration(const ValueDecl *Global) {
|
||||
const CXXRecordDecl *RD = MD->getParent();
|
||||
if (MD->isOutOfLine() && RD->isDynamicClass()) {
|
||||
const CXXMethodDecl *KeyFunction = getContext().getKeyFunction(RD);
|
||||
if (KeyFunction == MD->getCanonicalDecl())
|
||||
if (KeyFunction &&
|
||||
KeyFunction->getCanonicalDecl() == MD->getCanonicalDecl())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user