[cfe-commits] r139430 - in /cfe/trunk/lib/Serialization: ASTWriter.cpp ASTWriterDecl.cpp
Douglas Gregor
dgregor at apple.com
Fri Sep 9 16:07:59 PDT 2011
Author: dgregor
Date: Fri Sep 9 18:07:59 2011
New Revision: 139430
URL: http://llvm.org/viewvc/llvm-project?rev=139430&view=rev
Log:
Eliminate all but one caller of Decl::getPCHLevel()
Modified:
cfe/trunk/lib/Serialization/ASTWriter.cpp
cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=139430&r1=139429&r2=139430&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Fri Sep 9 18:07:59 2011
@@ -3140,8 +3140,6 @@
for (FirstLatestDeclMap::iterator I = FirstLatestDecls.begin(),
E = FirstLatestDecls.end();
I != E; ++I) {
- assert(I->first->getPCHLevel() > I->second->getPCHLevel() &&
- "Expected first & second to be in different PCHs");
AddDeclRef(I->first, FirstLatestDeclIDs);
AddDeclRef(I->second, FirstLatestDeclIDs);
}
Modified: cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterDecl.cpp?rev=139430&r1=139429&r2=139430&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriterDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriterDecl.cpp Fri Sep 9 18:07:59 2011
@@ -1021,7 +1021,7 @@
// in a chained PCH, keep track of the association with the map so we can
// update the first decl during AST reading.
if (First->getMostRecentDeclaration() == D &&
- First->getPCHLevel() > D->getPCHLevel()) {
+ First->isFromASTFile() && !D->isFromASTFile()) {
assert(Writer.FirstLatestDecls.find(First)==Writer.FirstLatestDecls.end()
&& "The latest is already set");
Writer.FirstLatestDecls[First] = D;
@@ -1243,7 +1243,7 @@
// in a chained PCH, keep track of the association with the map so we can
// update the first decl during AST reading.
if (ThisDecl != First && First->getMostRecentDeclaration() == ThisDecl &&
- First->getPCHLevel() > ThisDecl->getPCHLevel()) {
+ First->isFromASTFile() && !ThisDecl->isFromASTFile()) {
assert(Writer.FirstLatestDecls.find(First) == Writer.FirstLatestDecls.end()
&& "The latest is already set");
Writer.FirstLatestDecls[First] = ThisDecl;
More information about the cfe-commits
mailing list