diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-24 16:27:30 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-24 16:27:30 +0000 |
commit | 14afaf0093aaa4d3bd0ec9564ee241acc64ecbb6 (patch) | |
tree | 0ed169fdf65fd81a8b97ca5c3a1b76cc3891ad32 /clang/lib/Serialization | |
parent | 5519ff9d4ee1db2b7a3072e7d3df04013a4e8f1a (diff) | |
download | bcm5719-llvm-14afaf0093aaa4d3bd0ec9564ee241acc64ecbb6.tar.gz bcm5719-llvm-14afaf0093aaa4d3bd0ec9564ee241acc64ecbb6.zip |
Store the full list of pending instantiations in a chained PCH. Previously we attempted to store only new pending instantiations, but our filter was incorrect, dropping implicit instantiations of class template members. It's just not worth coming up with a complex filter that is correct, when the only cost is PCH files that are a few hundred bytes (at most) larger.
llvm-svn: 130098
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 22 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 6 |
2 files changed, 13 insertions, 15 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 3525c702078..addd73ba356 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -4118,22 +4118,22 @@ void ASTReader::InitializeSema(Sema &S) { SemaObj->ReferencedSelectors.insert(std::make_pair(Sel, SelLoc)); } } - - // If there were any pending implicit instantiations, deserialize them - // and add them to Sema's queue of such instantiations. - assert(F->PendingInstantiations.size() % 2 == 0 && - "Expected pairs of entries"); - for (unsigned Idx = 0, N = F->PendingInstantiations.size(); Idx < N;) { - ValueDecl *D=cast<ValueDecl>(GetDecl(F->PendingInstantiations[Idx++])); - SourceLocation Loc = ReadSourceLocation(*F, F->PendingInstantiations,Idx); - SemaObj->PendingInstantiations.push_back(std::make_pair(D, Loc)); - } } - // The two special data sets below always come from the most recent PCH, + // The special data sets below always come from the most recent PCH, // which is at the front of the chain. PerFileData &F = *Chain.front(); + // If there were any pending implicit instantiations, deserialize them + // and add them to Sema's queue of such instantiations. + assert(F.PendingInstantiations.size() % 2 == 0 && + "Expected pairs of entries"); + for (unsigned Idx = 0, N = F.PendingInstantiations.size(); Idx < N;) { + ValueDecl *D=cast<ValueDecl>(GetDecl(F.PendingInstantiations[Idx++])); + SourceLocation Loc = ReadSourceLocation(F, F.PendingInstantiations,Idx); + SemaObj->PendingInstantiations.push_back(std::make_pair(D, Loc)); + } + // If there were any weak undeclared identifiers, deserialize them and add to // Sema's list of weak undeclared identifiers. if (!WeakUndeclaredIdentifiers.empty()) { diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 7196a727183..fb193651b87 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -3039,10 +3039,8 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls, for (std::deque<Sema::PendingImplicitInstantiation>::iterator I = SemaRef.PendingInstantiations.begin(), N = SemaRef.PendingInstantiations.end(); I != N; ++I) { - if (I->first->getPCHLevel() == 0) { - AddDeclRef(I->first, PendingInstantiations); - AddSourceLocation(I->second, PendingInstantiations); - } + AddDeclRef(I->first, PendingInstantiations); + AddSourceLocation(I->second, PendingInstantiations); } assert(SemaRef.PendingLocalImplicitInstantiations.empty() && "There are local ones at end of translation unit!"); |