To improve mixed Swift/Objective-C frameworks, there should be a way to generate a header for the internal parts of a Swift framework that are also @objc. This would act like a "project" header in Xcode that does not get copied into the build products.
This hasn't been implemented in the past mainly because it requires splitting the internal members of a public class out to a category, but support for "delaying" members got added last year in PR 4155 anyway. This would just be another form of that.
Implementing this would involve something like the following:
- A new -emit-objc-internal-header-path command-line option.
- Rather than skipping over internal declarations in PrintAsObjC, adding them to a list much like the delayedMembers list today.
- Print all those declarations to a separate buffer, with a separate imports list.
- Write all that to a new header that imports <MyModule/MyModule-Swift.h>.
There are then Xcode-side changes that need to happen to make this a fully-supported feature, but this would be good enough to use it with a toolchain!