Building .swiftmodules for SourceKit

In addition to the proper amount of laziness, we'd need some way to communicate to the compiler that we're doing a compile for SourceKit. Right now, some external build system builds the .swiftmodules and then SourceKit reads them, so there is no way for the compiler to know that it doesn't need to put all the inlinealbe function SIL in the .swiftmodule. Maybe one of these ideas would be good:

  • A compiler option for building .swiftmodules without inlineable function SIL. The external build system could use this option when it knows that it's building the .swiftmodules only for SourceKit.
  • A "give me the public interface for this module" request that SourceKit can make when it needs the public interface.

On a different note, I just discovered "Update on implementation-only imports" which sounds like another exciting opportunity for reducing the amount of time it takes to build things for SourceKit. A compilation that only builds the public interface of imported modules shouldn't need any information about implementation only imports into those modules. If implementation only imports become the default (or if they're strongly encouraged), this could greatly cut down the amount of things we need to build.