diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-28 14:20:37 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-28 14:20:37 +0000 |
commit | ec12ce2f6da44bfc9048772327a3924498099d60 (patch) | |
tree | d0b5007de205fd0a4674df6f47b3b0108f5877ee /lib/Serialization/ASTWriter.cpp | |
parent | a26da1a97ea9afd87b175d32490c22f936c89000 (diff) |
Make Sema::LocallyScopedExternalDecls lazily deserialized. In theory,
we could turn this into an on-disk hash table so we don't load the
whole thing the first time we need it. However, it tends to be very,
very small (i.e., empty) for most precompiled headers, so it isn't all
that interesting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 9a666910b5..e63950e826 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -2876,9 +2876,11 @@ void ASTWriter::WriteASTCore(Sema &SemaRef, MemorizeStatCalls *StatCalls, for (llvm::DenseMap<DeclarationName, NamedDecl *>::iterator TD = SemaRef.LocallyScopedExternalDecls.begin(), TDEnd = SemaRef.LocallyScopedExternalDecls.end(); - TD != TDEnd; ++TD) - AddDeclRef(TD->second, LocallyScopedExternalDecls); - + TD != TDEnd; ++TD) { + if (TD->second->getPCHLevel() == 0) + AddDeclRef(TD->second, LocallyScopedExternalDecls); + } + // Build a record containing all of the ext_vector declarations. RecordData ExtVectorDecls; AddLazyVectorDecls(*this, SemaRef.ExtVectorDecls, ExtVectorDecls); |