[modules] Introduce Module::getTopLevelDecls() to get the local-in-module top-level decls.

getDisplayDecls() was introduced for ":print_module" and works slightly differently, e.g.
it will return the decls from a shadowed clang module, since we want to display them.

Swift SVN r7909
This commit is contained in:
Argyrios Kyrtzidis
2013-09-04 20:55:27 +00:00
parent 5065699eb3
commit 36a469df0b
9 changed files with 60 additions and 6 deletions

View File

@@ -288,6 +288,14 @@ SerializedModuleLoader::getLinkLibraries(const Module *module,
moduleFile->getLinkLibraries(callback);
}
void SerializedModuleLoader::getTopLevelDecls(const Module *Module,
SmallVectorImpl<Decl*> &Results) {
ModuleFile *ModuleFile = cast<SerializedModule>(Module)->File;
if (!ModuleFile)
return;
ModuleFile->getTopLevelDecls(Results);
}
void SerializedModuleLoader::getDisplayDecls(const Module *module,
SmallVectorImpl<Decl*> &results) {
ModuleFile *moduleFile = cast<SerializedModule>(module)->File;