diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-30 19:43:23 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-30 19:43:23 +0000 |
| commit | d3497db59b5706ba50b39403b1b7f5964b2bda53 (patch) | |
| tree | 7cc5b2d75def8fc581cc93ec104d02ffcc946a04 | |
| parent | 342e08fbf1f46a3f7ce49ea7c8cf7e84e757d1c3 (diff) | |
| download | bcm5719-llvm-d3497db59b5706ba50b39403b1b7f5964b2bda53.tar.gz bcm5719-llvm-d3497db59b5706ba50b39403b1b7f5964b2bda53.zip | |
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.
llvm-svn: 138816
| -rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 0d2a0154de9..0cd2c8c7b0b 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/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. |

