diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-05-06 23:32:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-05-06 23:32:38 +0000 |
commit | 0de016dbb7c774dce539e6f85023a2e2422ec684 (patch) | |
tree | d8f2db7dd4931d82ee9c35552be7e28825aa7399 /clang | |
parent | b578fbe0f256476aff51736bf5f8cb2ecbaf5f10 (diff) | |
download | bcm5719-llvm-0de016dbb7c774dce539e6f85023a2e2422ec684.tar.gz bcm5719-llvm-0de016dbb7c774dce539e6f85023a2e2422ec684.zip |
Implement a minor optimization by not introducing declarations into
DeclContext's lookup table when they aren't in any identifier namespace.
llvm-svn: 131037
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 8f3388ee589..1766d39c140 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -1166,10 +1166,10 @@ void DeclContext::makeDeclVisibleInContextImpl(NamedDecl *D) { if (!D->getDeclName()) return; - // FIXME: This feels like a hack. Should DeclarationName support - // template-ids, or is there a better way to keep specializations - // from being visible? - if (isa<ClassTemplateSpecializationDecl>(D) || D->isTemplateParameter()) + // Skip entities that can't be found by name lookup into a particular + // context. + if ((D->getIdentifierNamespace() == 0 && !isa<UsingDirectiveDecl>(D)) || + D->isTemplateParameter()) return; ASTContext *C = 0; |