summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2011-04-24 16:27:54 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2011-04-24 16:27:54 +0000
commitf830df4e9d1aa0c6971de46d0b8c899788443cb9 (patch)
tree8003dabd2a618462b66c1c33c167d0d4272d4146 /clang/lib/Serialization
parent83f3b859abfb1817089374542d1fe030e887d149 (diff)
downloadbcm5719-llvm-f830df4e9d1aa0c6971de46d0b8c899788443cb9.tar.gz
bcm5719-llvm-f830df4e9d1aa0c6971de46d0b8c899788443cb9.zip
On reading DeclContexts from PCH, check for visible updates even if the context was empty in the original version. Also, if there are any, tell the context that it has external visible decls. This fixes the problem that a namespace that was empty in the initial PCH (could also happen if the initial PCH didn't include any std header but caused implicit creation of namespace std, e.g. due to implicit declaration of a virtual destructor) never found any declaration declared in *any* chained PCH. Very ugly when the chained PCH includes all that std stuff, as the errors were effectively the same as not including std headers.
llvm-svn: 130102
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 8190eabc00a..4d2da8decb1 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -1661,22 +1661,26 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) {
// so we need to make sure we insert in front. For all other contexts,
// the vector is empty here anyway, so there's no loss in efficiency.
Infos.insert(Infos.begin(), Info);
+ }
- // Now add the pending visible updates for this decl context, if it has
- // any.
- DeclContextVisibleUpdatesPending::iterator I =
- PendingVisibleUpdates.find(ID);
- if (I != PendingVisibleUpdates.end()) {
- DeclContextVisibleUpdates &U = I->second;
- Info.LexicalDecls = 0;
- Info.NumLexicalDecls = 0;
- for (DeclContextVisibleUpdates::iterator UI = U.begin(), UE = U.end();
- UI != UE; ++UI) {
- Info.NameLookupTableData = *UI;
- Infos.push_back(Info);
- }
- PendingVisibleUpdates.erase(I);
+ // Now add the pending visible updates for this decl context, if it has any.
+ DeclContextVisibleUpdatesPending::iterator I =
+ PendingVisibleUpdates.find(ID);
+ if (I != PendingVisibleUpdates.end()) {
+ // There are updates. This means the context has external visible
+ // storage, even if the original stored version didn't.
+ DC->setHasExternalVisibleStorage(true);
+ DeclContextVisibleUpdates &U = I->second;
+ DeclContextInfos &Infos = DeclContextOffsets[DC];
+ DeclContextInfo Info;
+ Info.LexicalDecls = 0;
+ Info.NumLexicalDecls = 0;
+ for (DeclContextVisibleUpdates::iterator UI = U.begin(), UE = U.end();
+ UI != UE; ++UI) {
+ Info.NameLookupTableData = *UI;
+ Infos.push_back(Info);
}
+ PendingVisibleUpdates.erase(I);
}
}
assert(Idx == Record.size());
OpenPOWER on IntegriCloud