diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-24 00:50:16 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-24 00:50:16 +0000 |
commit | 5967d6228f183a5fa384f2f1918df679ed2d8666 (patch) | |
tree | b48a3c221500177826b3711880470c11f3be2df7 /lib/Serialization/ASTWriter.cpp | |
parent | 1d1e42b17da6a53391d50b08068ecde04311e368 (diff) |
Add testcase for C++ chained PCH and fix the bugs it uncovered in name lookup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index dc9f4d409a..43bb7ad4c7 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -2101,23 +2101,13 @@ void ASTWriter::WriteDeclContextVisibleUpdate(const DeclContext *DC) { ASTDeclContextNameLookupTrait Trait(*this); // Create the hash table. - llvm::SmallVector<NamedDecl *, 16> Decls; for (StoredDeclsMap::iterator D = Map->begin(), DEnd = Map->end(); D != DEnd; ++D) { DeclarationName Name = D->first; DeclContext::lookup_result Result = D->second.getLookupResult(); - // Need to filter these results to only include decls that are not from - // an existing PCH. - Decls.clear(); - for (; Result.first != Result.second; ++Result.first) { - if ((*Result.first)->getPCHLevel() == 0) - Decls.push_back(*Result.first); - } - if (!Decls.empty()) { - Result.first = Decls.data(); - Result.second = Result.first + Decls.size(); - Generator.insert(Name, Result, Trait); - } + // 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); } // Create the on-disk hash table in a buffer. |