summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-05 19:06:31 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-05 19:06:31 +0000
commita318efd1f21a21358f45a201f7b6cb2b8b118ec0 (patch)
treea4ce378e010ad14d8fd2ec042050df78be33568d /clang/lib/CodeGen/CodeGenModule.cpp
parent79ed590c85749e088e80506c831a3da292122c9c (diff)
downloadbcm5719-llvm-a318efd1f21a21358f45a201f7b6cb2b8b118ec0.tar.gz
bcm5719-llvm-a318efd1f21a21358f45a201f7b6cb2b8b118ec0.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 16a01cfd58f..85d57e7cbec 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -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;
}
}
OpenPOWER on IntegriCloud