[NFC] Clarify semantics of getImportedModules.

The lack of clarity manifested as unexpected behavior when using
getImportedModules to create the module import graph. The new behavior
makes SPI-ness and Shadowing-ness behave similarly in terms of
filtering. We also check if a filter is well-formed to avoid
accidental empty import lists.
This commit is contained in:
Varun Gandhi
2020-09-23 10:43:57 -07:00
parent d3369f7711
commit 4b5d885114
6 changed files with 57 additions and 7 deletions

View File

@@ -116,7 +116,8 @@ static void printImports(raw_ostream &out,
SmallVector<ModuleDecl::ImportedModule, 4> ioiImport;
M->getImportedModules(ioiImport,
ModuleDecl::ImportFilterKind::ImplementationOnly);
{ModuleDecl::ImportFilterKind::ImplementationOnly,
ModuleDecl::ImportFilterKind::SPIAccessControl});
ioiImportSet.insert(ioiImport.begin(), ioiImport.end());
}