[cfe-commits] r131037 - /cfe/trunk/lib/AST/DeclBase.cpp

Douglas Gregor dgregor at apple.com
Fri May 6 16:32:38 PDT 2011


Author: dgregor
Date: Fri May  6 18:32:38 2011
New Revision: 131037

URL: http://llvm.org/viewvc/llvm-project?rev=131037&view=rev
Log:
Implement a minor optimization by not introducing declarations into
DeclContext's lookup table when they aren't in any identifier namespace.


Modified:
    cfe/trunk/lib/AST/DeclBase.cpp

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=131037&r1=131036&r2=131037&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Fri May  6 18:32:38 2011
@@ -1166,10 +1166,10 @@
   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;





More information about the cfe-commits mailing list