diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-24 00:50:04 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-24 00:50:04 +0000 |
commit | e1dde811b38e779894150cb1093d57f8411a84f7 (patch) | |
tree | aaf08f23e8aa559ac49315f7f09dcc1d0fc97fcc /lib/Serialization/ASTReaderDecl.cpp | |
parent | 0ea8f7f5a4eba47ae226dd47c6dce39eef0c554c (diff) |
Read the UPDATE_VISIBLE record, and add its visible decls to the lookup tables. Also, free the lookup tables when destructing the ASTReader.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | lib/Serialization/ASTReaderDecl.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 0ee8c83183..d2fb408e56 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/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()); |