[serialization] Hook up basic name lookup for imported modules.

Also, explicitly list the top-level decls in a module. Eventually this
will be a proper lazily-loaded identifier-DeclID map, but for now it's
just a flat list of IDs to deserialize as soon as a lookup is
requested.

We can now parse and typecheck a file that imports typealiases of builtin
types.

Swift SVN r5325
This commit is contained in:
Jordan Rose
2013-05-25 01:34:57 +00:00
parent 76b19d53c4
commit 7a13e58b38
6 changed files with 89 additions and 13 deletions

View File

@@ -182,6 +182,22 @@ Module *SerializedModuleLoader::loadModule(SourceLoc importLoc,
return module;
}
void SerializedModuleLoader::lookupValue(Module *module,
Module::AccessPathTy accessPath,
Identifier name, NLKind lookupKind,
SmallVectorImpl<ValueDecl*> &results) {
// FIXME: handle nested modules.
if (!accessPath.empty())
return;
ModuleFile *moduleFile = cast<SerializedModule>(module)->File;
if (!moduleFile)
return;
moduleFile->lookupValue(name, results);
}
void SerializedModuleLoader::loadExtensions(NominalTypeDecl *nominal,
unsigned previousGeneration) {
// FIXME: Look for extensions of the given nominal type within the