]> granicus.if.org Git - clang/commitdiff
Implement a trivial, obvious optimization for deserialization of
authorDouglas Gregor <dgregor@apple.com>
Wed, 21 Dec 2011 15:12:03 +0000 (15:12 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 21 Dec 2011 15:12:03 +0000 (15:12 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147055 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Serialization/ASTReaderDecl.cpp

index 77ea318dc0749edfc480c9166fac13b66f2ffbb5..163cbadcd38df125413e62043b69dfa6d2976475 100644 (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);
 }
 
 //===----------------------------------------------------------------------===//