aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-17 18:13:45 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-17 18:13:45 +0000
commit3efe999a9a3b7b71cf18d8751ec6068f24425c1b (patch)
tree76482f626e1aa9b2a942878999a7aad08104d738
parenta6ea10e22b600d92e084f6b11b9b9a92d0eb2412 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148314 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 7fc54bbba4..1f908e7651 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -2131,7 +2131,10 @@ namespace {
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)