summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-21 22:32:33 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-21 22:32:33 +0000
commitb475a5ca95ef402f37b5384fc7ae2ef382736e91 (patch)
tree33842d151bf71f753ced18f4b89b48f8cf8d84c0 /clang/lib/Frontend/PCHWriter.cpp
parent497d7b0c8acd6d55555b11e3d49121da71a5cf1d (diff)
downloadbcm5719-llvm-b475a5ca95ef402f37b5384fc7ae2ef382736e91.tar.gz
bcm5719-llvm-b475a5ca95ef402f37b5384fc7ae2ef382736e91.zip
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. llvm-svn: 69739
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r--clang/lib/Frontend/PCHWriter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp
index 993ba9266fc..11672506243 100644
--- a/clang/lib/Frontend/PCHWriter.cpp
+++ b/clang/lib/Frontend/PCHWriter.cpp
@@ -1595,9 +1595,11 @@ uint64_t PCHWriter::WriteDeclContextVisibleBlock(ASTContext &Context,
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.
OpenPOWER on IntegriCloud