[swift-evolution] Pitch: Cross-module inlining and specialization

Greg Parker gparker at apple.com
Mon Oct 2 16:20:13 CDT 2017

> On Oct 2, 2017, at 1:31 PM, Slava Pestov via swift-evolution <swift-evolution at swift.org> wrote:
> inlinable declarations can only reference other public declarations. This is because they can be emitted into the client binary, and are therefore limited to referencing symbols that the client binary can reference.

Private @inlinable functions are useful. For example, you might want a helper function to be inlined into a public @inlinable function for performance, but you don't want that helper function to be called by outside clients directly. 

The restriction would then be "inlinable declarations can only reference other public declarations and other @inlinable non-public declarations". This relaxation would have no affect on ABI: only @inlinable things could be inlined, and only public things could be ultimately referenced by inlined things. 

Having said that, it should be fine to use "public @inlinable only" for now and consider relaxing the restriction later.

Greg Parker     gparker at apple.com <mailto:gparker at apple.com>     Runtime Wrangler

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171002/d551cf61/attachment.html>

More information about the swift-evolution mailing list