mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The reason why I am doing this is that I am going to be adding support for preconcurrency imports to TransferNonSendable. That implies that we can have preconcurrency import suppression in the SIL pipeline and thus that emitting the diagnostic in Sema is too early. To do this, I introduced a new module pass called DiagnoseUnnecessaryPreconcurrencyImports that runs after the SILFunction pass TransferNonSendable. The reason why I use a module pass is to ensure that TransferNonSendable has run on all functions before we attempt to emit these diagnostics. Then in that pass, we iterate over all of the modules functions and construct a uniqued array of SourceFiles for these functions. Then we iterate over the uniqued SourceFiles and use the already constructed Sema machinery to emit the diagnostic using the source files. rdar://126928265