diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-21 22:32:33 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-21 22:32:33 +0000 |
commit | aff22dff5ecc8955d51dfdc107e6b034c30c1512 (patch) | |
tree | 64415f5bc05f7636f618885212546d53033d11fe /lib/Frontend/PCHWriter.cpp | |
parent | 17f3a6d0d8026238830eacd0d765267a6ced4edc (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 993ba9266f..1167250624 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/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. |