Verify that _Concurrency *can* be imported on implicit import.

In case the compiler is used with concurrency features enabled (by-default or otherwise), and an older SDK is used which does not include the `_Concurrency` module, do not load this module implicitly. Instead, emit a diagnostic indicating that no such module is found.

rdar://76967260
This commit is contained in:
Artem Chikin
2021-04-21 18:56:09 -07:00
parent 16adf76b68
commit f92abb8c81
6 changed files with 74 additions and 3 deletions

View File

@@ -529,6 +529,14 @@ public:
return getMainModule()->getPrimarySourceFiles();
}
/// Verify that if an implicit import of the `Concurrency` module if expected,
/// it can actually be imported. Emit a warning, otherwise.
void verifyImplicitConcurrencyImport();
/// Whether the Swift Concurrency support library can be imported
/// i.e. if it can be found.
bool canImportSwiftConcurrency() const;
/// Gets the SourceFile which is the primary input for this CompilerInstance.
/// \returns the primary SourceFile, or nullptr if there is no primary input;
/// if there are _multiple_ primary inputs, fails with an assertion.