[cfe-commits] r69739 - /cfe/trunk/lib/Frontend/PCHWriter.cpp

Douglas Gregor dgregor at apple.com
Tue Apr 21 15:32:34 PDT 2009


Author: dgregor
Date: Tue Apr 21 17:32:33 2009
New Revision: 69739

URL: http://llvm.org/viewvc/llvm-project?rev=69739&view=rev
Log:
Don't bother writing a visible-declarations record for the translation
unit into the PCH file, since we won't be performing name lookup into
it anyway. Reduces the size of the Carbon.h PCH file by ~200k.

Modified:
    cfe/trunk/lib/Frontend/PCHWriter.cpp

Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=69739&r1=69738&r2=69739&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Tue Apr 21 17:32:33 2009
@@ -1595,9 +1595,11 @@
   if (DC->getPrimaryContext() != DC)
     return 0;
 
-  // Since there is no name lookup into functions or methods, don't
-  // bother to build a visible-declarations table.
-  if (DC->isFunctionOrMethod())
+  // Since there is no name lookup into functions or methods, and we
+  // perform name lookup for the translation unit via the
+  // IdentifierInfo chains, don't bother to build a
+  // visible-declarations table for these entities.
+  if (DC->isFunctionOrMethod() || DC->isTranslationUnit())
     return 0;
 
   // Force the DeclContext to build a its name-lookup table.





More information about the cfe-commits mailing list