diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-06-10 21:53:06 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-06-10 21:53:06 +0000 |
commit | 300f55dcade947fa75ff659e9884b67eb213d9b3 (patch) | |
tree | 1200e7437fc101bd5855c65a686f1b8d61712fec /clang/lib/AST/RecordLayoutBuilder.cpp | |
parent | c51d334912082759d072a5e8aaed67c18c5bdc76 (diff) | |
download | bcm5719-llvm-300f55dcade947fa75ff659e9884b67eb213d9b3.tar.gz bcm5719-llvm-300f55dcade947fa75ff659e9884b67eb213d9b3.zip |
PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates.
While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp.
llvm-svn: 132861
Diffstat (limited to 'clang/lib/AST/RecordLayoutBuilder.cpp')
-rw-r--r-- | clang/lib/AST/RecordLayoutBuilder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp index 3c397a2059b..de0b1d0ed9d 100644 --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -1757,10 +1757,10 @@ RecordLayoutBuilder::ComputeKeyFunction(const CXXRecordDecl *RD) { if (!RD->isPolymorphic()) return 0; - // A class inside an anonymous namespace doesn't have a key function. (Or + // A class that is not externally visible doesn't have a key function. (Or // at least, there's no point to assigning a key function to such a class; // this doesn't affect the ABI.) - if (RD->isInAnonymousNamespace()) + if (RD->getLinkage() != ExternalLinkage) return 0; // Template instantiations don't have key functions,see Itanium C++ ABI 5.2.6. |