[cfe-commits] r148314 - /cfe/trunk/lib/Serialization/ASTReaderDecl.cpp

Douglas Gregor dgregor at apple.com
Tue Jan 17 10:13:45 PST 2012


Author: dgregor
Date: Tue Jan 17 12:13:45 2012
New Revision: 148314

URL: http://llvm.org/viewvc/llvm-project?rev=148314&view=rev
Log:
When collecting all of the redeclarations of a declaration loaded from
a module file, be sure to also add the first (potentially canonical)
declarations to the chain. This isn't guaranteed to occur because the
first declaration is not listed in the stored redeclaration chain.

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=148314&r1=148313&r2=148314&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Tue Jan 17 12:13:45 2012
@@ -2131,7 +2131,10 @@
                        llvm::SmallPtrSet<Decl *, 16> &Deserialized,
                        GlobalDeclID CanonID)
       : Reader(Reader), SearchDecls(SearchDecls), Deserialized(Deserialized),
-        CanonID(CanonID) { }
+        CanonID(CanonID) { 
+      for (unsigned I = 0, N = SearchDecls.size(); I != N; ++I)
+        addToChain(Reader.GetDecl(SearchDecls[I]));
+    }
     
     static bool visit(ModuleFile &M, bool Preorder, void *UserData) {
       if (Preorder)





More information about the cfe-commits mailing list