aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-08-30 19:43:23 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-08-30 19:43:23 +0000
commit45118d8f2b50a37472dd03cd1d5b4abd7ae9f25b (patch)
tree2747bc7b8d13a7de7fe763c715b80d1833176be2 /lib/Serialization/ASTWriter.cpp
parent2334f3aeda318f68e763379afa5ac7a91b90caa7 (diff)
In ASTWriter::WriteDeclContextVisibleBlock, don't write empty lookups.
Empty lookups can occur in the DeclContext map when we are chaining PCHs, where the empty lookup indicates that we already looked in ExternalASTSource. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138816 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index 0d2a0154de..0cd2c8c7b0 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -2628,7 +2628,8 @@ uint64_t ASTWriter::WriteDeclContextVisibleBlock(ASTContext &Context,
D != DEnd; ++D) {
DeclarationName Name = D->first;
DeclContext::lookup_result Result = D->second.getLookupResult();
- Generator.insert(Name, Result, Trait);
+ if (Result.first != Result.second)
+ Generator.insert(Name, Result, Trait);
}
// Create the on-disk hash table in a buffer.
@@ -2673,7 +2674,8 @@ void ASTWriter::WriteDeclContextVisibleUpdate(const DeclContext *DC) {
DeclContext::lookup_result Result = D->second.getLookupResult();
// For any name that appears in this table, the results are complete, i.e.
// they overwrite results from previous PCHs. Merging is always a mess.
- Generator.insert(Name, Result, Trait);
+ if (Result.first != Result.second)
+ Generator.insert(Name, Result, Trait);
}
// Create the on-disk hash table in a buffer.