ModuleInterface: Print imports with @preconcurrency in swiftinterface files.

When a module has been imported `@preconcurrency` in source, when it is printed
in a `swiftinterface` file it should be printed along with the attribute to
ensure that type checking of the module's public declarations behaves
consistently.

This fix is a little unsatisfying because it adds another a linear scan over
all imports in the source for each printed import. This should be improved, but
it can be done later.

Resolves rdar://136857313.
This commit is contained in:
Allan Shortlidge
2025-09-15 17:05:12 -07:00
parent 01873c996f
commit 4841bcffa1
8 changed files with 98 additions and 0 deletions

View File

@@ -466,6 +466,9 @@ public:
const ModuleDecl *importedModule,
llvm::SmallSetVector<Identifier, 4> &spiGroups) const override;
virtual bool isModuleImportedPreconcurrency(
const ModuleDecl *importedModule) const override;
std::optional<CommentInfo> getCommentForDecl(const Decl *D) const override;
bool hasLoadedSwiftDoc() const override;