summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-08-24 21:56:08 +0000
committerDouglas Gregor <dgregor@apple.com>2011-08-24 21:56:08 +0000
commita3e59b49e7e91abd97f31e3b1402d7356ac9fd74 (patch)
tree1e9679605b8287c767c50492f1c8328ed3e4355a /clang/lib/Serialization/ASTReader.cpp
parent4b701af908a01dc2edc36bd46947f24df4de8e68 (diff)
downloadbcm5719-llvm-a3e59b49e7e91abd97f31e3b1402d7356ac9fd74.tar.gz
bcm5719-llvm-a3e59b49e7e91abd97f31e3b1402d7356ac9fd74.zip
Don't force the complete deserialization of the visible-declarations
table when serializing an AST file. This was a holdover from the days before chained PCH, and is a complete waste of time and storage now. It's a good thing it's useless, because I have no idea how I would have implemented MaterializeVisibleDecls efficiently in the presence of modules. llvm-svn: 138496
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp40
1 files changed, 0 insertions, 40 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 0a2992baa57..cb1498e8154 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -4405,46 +4405,6 @@ ASTReader::FindExternalVisibleDeclsByName(const DeclContext *DC,
return const_cast<DeclContext*>(DC)->lookup(Name);
}
-void ASTReader::MaterializeVisibleDecls(const DeclContext *DC) {
- assert(DC->hasExternalVisibleStorage() &&
- "DeclContext has no visible decls in storage");
-
- SmallVector<NamedDecl *, 64> Decls;
- // There might be visible decls in multiple parts of the chain, for the TU
- // and namespaces.
- // There might be lexical decls in multiple modules, for the TU at
- // least.
- // FIXME: We might want a faster way to zero
- // FIXME: Going backwards through the chain does the right thing for
- // chained PCH; for modules, it isn't clear what the right thing is.
- for (ModuleReverseIterator M = ModuleMgr.rbegin(), MEnd = ModuleMgr.rend();
- M != MEnd; ++M) {
- Module::DeclContextInfosMap::iterator Info
- = (*M)->DeclContextInfos.find(DC);
- if (Info == (*M)->DeclContextInfos.end() || !Info->second.LexicalDecls)
- continue;
-
- if (!Info->second.NameLookupTableData)
- continue;
-
- ASTDeclContextNameLookupTable *LookupTable =
- (ASTDeclContextNameLookupTable*)Info->second.NameLookupTableData;
- for (ASTDeclContextNameLookupTable::item_iterator
- ItemI = LookupTable->item_begin(),
- ItemEnd = LookupTable->item_end() ; ItemI != ItemEnd; ++ItemI) {
- ASTDeclContextNameLookupTable::item_iterator::value_type Val
- = *ItemI;
- ASTDeclContextNameLookupTrait::data_type Data = Val.second;
- Decls.clear();
- for (; Data.first != Data.second; ++Data.first) {
- if (NamedDecl *ND = GetLocalDeclAs<NamedDecl>(**M, *Data.first))
- Decls.push_back(ND);
- }
- MaterializeVisibleDeclsForName(DC, Val.first, Decls);
- }
- }
-}
-
void ASTReader::PassInterestingDeclsToConsumer() {
assert(Consumer);
while (!InterestingDecls.empty()) {
OpenPOWER on IntegriCloud