Dependencies: Add new options to qualified lookup for known dependencies.

Specifically, a qualified lookup can now be treated as:
- a known private dependency, which does not affect downstream files
- a known non-private dependency, which may affect downstream files
- a known non-dependency
- unknown, which means the compiler will try to infer whether it's a
  private dependency from the context

This commit also includes some obvious uses of the new flags, but nothing
actually too interesting yet; there shouldn't be any observable behavior
change here in normal user code.

Swift SVN r23483
This commit is contained in:
Jordan Rose
2014-11-20 20:58:17 +00:00
parent cb1bf10f81
commit 985cbb8b2a
8 changed files with 86 additions and 18 deletions

View File

@@ -1010,7 +1010,8 @@ void ModuleFile::getImportDecls(SmallVectorImpl<Decl *> &Results) {
} else {
SmallVector<ValueDecl *, 8> Decls;
M->lookupQualified(ModuleType::get(M), ScopeID,
NL_QualifiedDefault, nullptr, Decls);
NL_QualifiedDefault | NL_KnownNoDependency,
nullptr, Decls);
Optional<ImportKind> FoundKind = ImportDecl::findBestImportKind(Decls);
assert(FoundKind.hasValue() &&
"deserialized imports should not be ambigous");