summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-08-24 00:50:04 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-08-24 00:50:04 +0000
commitd7dce0a44dce112fccd2ec715a31f23fd22627a7 (patch)
treedd7d5ccdb79ffd42a9b9a3a0a3eaf5ca413d0ba2 /clang/lib/Serialization/ASTReaderDecl.cpp
parent9d8f58b5d78679475ddbcc909a39816232ab96a8 (diff)
downloadbcm5719-llvm-d7dce0a44dce112fccd2ec715a31f23fd22627a7.tar.gz
bcm5719-llvm-d7dce0a44dce112fccd2ec715a31f23fd22627a7.zip
Read the UPDATE_VISIBLE record, and add its visible decls to the lookup tables. Also, free the lookup tables when destructing the ASTReader.
llvm-svn: 111880
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 0ee8c83183a..d2fb408e56c 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -1402,10 +1402,26 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) {
if (ReadDeclContextStorage(DeclsCursor, Offsets, Info))
return 0;
DeclContextInfos &Infos = DeclContextOffsets[DC];
- // Reading the TU will happen after reading its update blocks, 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.
+ // Reading the TU will happen after reading its lexical update blocks,
+ // 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);
+ }
}
}
assert(Idx == Record.size());
OpenPOWER on IntegriCloud