[cfe-commits] r147055 - /cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Douglas Gregor
dgregor at apple.com
Wed Dec 21 07:12:04 PST 2011
Author: dgregor
Date: Wed Dec 21 09:12:03 2011
New Revision: 147055
URL: http://llvm.org/viewvc/llvm-project?rev=147055&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=147055&r1=147054&r2=147055&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed Dec 21 09:12:03 2011
@@ -1416,8 +1416,8 @@
}
// 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);
}
//===----------------------------------------------------------------------===//
More information about the cfe-commits
mailing list