The Embedded Swift concurrency library needs a way to exit the program
at the end of async main. The existing implementation calls through a
_swift_exit() function to the POSIX/C exit(). Enshrine _swift_exit()
as part of the Platform Abstraction Layer, with the same signature
(albeit in C), and implement it in the PAL-on-POSIX library as a call
through to exit().
rdar://158239258
This change adds logic in the compiler to compute malloc type ids and emit them together with typed allocation calls. It also adds the new runtime function swift_allocObjectTyped, which calls typed malloc.
The new library, swiftEmbeddedPlatformPOSIX, implements all of the
_swift_XYZ functions needed to support Embedded Swift as shims on top
of a POSIX system that provides posix_memalign, free, putchar, and so
on. This offers an easier way to bridge between the prior ad hoc
requirements of Embedded Swift and the newer platform abstraction
layer.
Part of rdar://164057124