Add support for :print_module on Clang modules.

This isn't very efficient: it scans every decl in the Clang TU (forcing
deserialization) and filters based on the decl's enclosing module.
Moreover, since getClangModuleForDecl() currently only handles top-level
modules, all submodules get implicitly added to the top-level module...
and will /not/ match an explicit submodule request.

(This is probably close to the behavior we actually want: include decls that
are from modules that are (a) submodules and (b) re-exported by the top-level
module. We do want that extra check, though, and we would want to find things
specifically by submodule.)

Swift SVN r7602
This commit is contained in:
Jordan Rose
2013-08-26 23:07:54 +00:00
parent eef39ff914
commit 9b9e669bf7
3 changed files with 27 additions and 0 deletions

View File

@@ -641,6 +641,9 @@ void ModuleFile::getLinkLibraries(Module::LinkLibraryCallback callback) const {
}
void ModuleFile::getDisplayDecls(SmallVectorImpl<Decl *> &results) {
if (ShadowedModule)
ShadowedModule->getDisplayDecls(results);
if (OperatorDecls) {
for (auto entry : make_range(OperatorDecls->data_begin(),
OperatorDecls->data_end())) {