Basic implementation of lookupVisibleDecls() for serialized modules.

This involved threading it through ModuleLoader, as with all the other
module-generic callbacks. I plan to collapse a bit of the chaining, but
unfortunately not that much.

This brings back the CodeCompletion tests.

Swift SVN r6527
This commit is contained in:
Jordan Rose
2013-07-23 23:10:28 +00:00
parent 0d3e410fc4
commit 8e081367ca
8 changed files with 55 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
#include "ModuleFormat.h"
#include "swift/AST/AST.h"
#include "swift/AST/ModuleLoader.h"
#include "swift/AST/NameLookup.h"
#include "swift/Basic/STLExtras.h"
#include "swift/Serialization/BCReadingExtras.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -2213,3 +2214,13 @@ void ModuleFile::getReexportedModules(
results.push_back({Module::AccessPathTy(), dep.Mod});
}
void ModuleFile::lookupVisibleDecls(Module::AccessPathTy accessPath,
VisibleDeclConsumer &consumer,
NLKind lookupKind) {
// FIXME: Validate against access path.
for (auto &topLevelEntry : TopLevelDecls) {
for (auto &value : topLevelEntry.second)
consumer.foundDecl(value);
}
}