summaryrefslogtreecommitdiffstats
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
commit41dc6ff524b3902d6a35b45acc41761b62bf37dd (patch)
tree60a0707d885718f13b79edd0d015536f8693f9a8
parentd53ae83516a1005f91e111ce309e17bfac540637 (diff)
downloadbcm5719-llvm-41dc6ff524b3902d6a35b45acc41761b62bf37dd.tar.gz
bcm5719-llvm-41dc6ff524b3902d6a35b45acc41761b62bf37dd.zip
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. llvm-svn: 148314
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 7fc54bbba41..1f908e76512 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud