[cfe-dev] [llvm-dev] RFC: Implementing the Swift calling convention in LLVM and Clang

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 2 11:09:00 PST 2016


On 2 Mar 2016, at 19:04, Renato Golin via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> I personally don't. I think we should treat Swift as any other
> language that we support, and if we can't use existing mechanisms in
> the back-end to lower Swift, then we need to expand the back-end to
> support that.
> 
> That being said, if the Swift support starts to bit-rot (if, for
> instance, Apple stops supporting it in the future), it will be harder
> to clean up the back-end from its CC. But that, IMHO, is a very
> far-fetched future and a small price to pay.

The Swift calling model also seems to be quite generally useful.  I can imagine that VMKit would have used it, if it had been available then.

My only concern is that the implicit contract between the front and back ends, with regard to calling convention, is already complex, already largely undocumented, and already difficult to infer even if you have the relevant platform ABI document in front of you.  It is badly in need of some cleanup and I wonder if the desire to minimise diffs for Swift might provide Apple with some incentive to spend a little bit of engineering effort on it?

David



More information about the cfe-dev mailing list