Implement a trivial, obvious optimization for deserialization of

redeclaration chains: only ever have the reader search for
redeclarations of the first (canonical) declaration, since we only
ever record redeclaration ranges for the that declaration. Searching
for redeclarations of non-canonical declarations will never find
anything, so it's a complete waste of time.

llvm-svn: 147055
This commit is contained in:
Douglas Gregor 2011-12-21 15:12:03 +00:00
parent 46f0c15208
commit 596b7cbc19
1 changed files with 2 additions and 2 deletions

View File

@ -1416,8 +1416,8 @@ void ASTDeclReader::VisitRedeclarable(Redeclarable<T> *D) {
}
// Note that we need to load the other declaration chains for this ID.
if (Reader.PendingDeclChainsKnown.insert(ThisDeclID))
Reader.PendingDeclChains.push_back(ThisDeclID);
if (Reader.PendingDeclChainsKnown.insert(FirstDeclID))
Reader.PendingDeclChains.push_back(FirstDeclID);
}
//===----------------------------------------------------------------------===//