mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
swift_coroFrameAlloc was introduced in the Swift 6.2 runtime. Give it the appropriate availability in IRGen, so that it gets weak availability when needed (per the deployment target). Then, only create the stub function for calling into swift_coroFrameAlloc or malloc (when the former isn't available) when we're back-deploying to a runtime prior to Swift 6.2. This is a small code size/performance win when allocating coroutine frames on Swift 6.2-or-newer platforms. This has a side effect of fixing a bug in Embedded Swift, where the swift_coroFrameAlloc was getting unconditionally set to have weak external linkage despite behind defined in the same LLVM module (because it comes from the standard library). Fixes rdar://149695139 / issue #80947.