aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-02-11 00:52:17 +0000
committerDouglas Gregor <dgregor@apple.com>2011-02-11 00:52:17 +0000
commit217cacc7f8542a3b87309f30ecfed69cbc4afe04 (patch)
tree0cb914129ecf6fa81a3f3a1ec54c2277588bc55b /lib/Serialization/ASTWriter.cpp
parent040a804f852c45c8b8c371ce1d421fd4cd84b6fb (diff)
Eliminate a major performance problem with chained PCH, where we were
causing the deserialization of a large number of declarations when writing the visible-updates record for the translation unit in C. This takes us from: *** AST File Statistics: 2 stat cache hits 6 stat cache misses 1/64463 source location entries read (0.001551%) 15606/16956 types read (92.038216%) 59266/89334 declarations read (66.342041%) 38952/61393 identifiers read (63.446976%) 0/7778 selectors read (0.000000%) 24192/34644 statements read (69.830276%) 388/8809 macros read (4.404586%) 2095/5189 lexical declcontexts read (40.373867%) 0/4587 visible declcontexts read (0.000000%) 0/7716 method pool entries read (0.000000%) 0 method pool misses to *** AST File Statistics: 2 stat cache hits 6 stat cache misses 1/64463 source location entries read (0.001551%) 26/16956 types read (0.153338%) 18/89334 declarations read (0.020149%) 145/61393 identifiers read (0.236183%) 0/7778 selectors read (0.000000%) 21/34644 statements read (0.060617%) 0/8809 macros read (0.000000%) 0/5189 lexical declcontexts read (0.000000%) 0/4587 visible declcontexts read (0.000000%) 0/7716 method pool entries read (0.000000%) 0 method pool misses when generating a chained PCH for a header that #includes Cocoa.h (from a PCH file) and adds one simple function declaration. The generated PCH file is now only 9580 bytes (down from > 2MB). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125326 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index ce68649142..f1af8354a2 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -2475,10 +2475,6 @@ uint64_t ASTWriter::WriteDeclContextVisibleBlock(ASTContext &Context,
/// DeclContext in a dependent AST file. As such, they only exist for the TU
/// (in C++) and for namespaces.
void ASTWriter::WriteDeclContextVisibleUpdate(const DeclContext *DC) {
- // Make the context build its lookup table, but don't make it load external
- // decls.
- DC->lookup(DeclarationName());
-
StoredDeclsMap *Map = static_cast<StoredDeclsMap*>(DC->getLookupPtr());
if (!Map || Map->empty())
return;