Add -Rcross-import option

It is an optional, user-accessible mechanism to have the compiler tell you what it’s cross-importing.

Resolves rdar://problem/60381893
This commit is contained in:
Artem Chikin
2020-04-02 15:56:19 -07:00
parent cf608c0c9a
commit b679fd8738
6 changed files with 31 additions and 0 deletions

View File

@@ -914,6 +914,11 @@ void ImportResolver::findCrossImports(
declaringImport.module.second->getName(),
bystandingImport.module.second->getName(), name);
if (ctx.LangOpts.EnableCrossImportRemarks)
ctx.Diags.diagnose(I.importLoc, diag::cross_import_added,
declaringImport.module.second->getName(),
bystandingImport.module.second->getName(), name);
LLVM_DEBUG({
auto &crossImportOptions = unboundImports.back().options;
llvm::dbgs() << " ";