Commit Graph

18 Commits

Author SHA1 Message Date
Nate Chandler
e0ead75622 [CoroutineAccessors] Use typed-malloc. 2025-10-30 03:59:18 -07:00
Nate Chandler
05f259f6f6 [NFC] IRGen: Extract this function. 2025-10-30 03:59:17 -07:00
Nate Chandler
69a40d553e [NFC] IRGen: Deduplicate this code. 2025-10-30 03:59:17 -07:00
Nate Chandler
042579b010 [IRGen] Address-discriminate these ptrauth ents.
They are stored at an address so that address should be used to
strengthen auth.
2025-10-27 16:09:53 -07:00
Nate Chandler
5ca69102ff [Gardening] IRGen: Whitespace. 2025-10-27 16:09:48 -07:00
Nate Chandler
bc1071df5d [IRGen] Factor out this function. 2025-10-27 15:24:53 -07:00
Nate Chandler
cdf9f9d58b [CoroutineAccessors] Forward frame to de/alloc fns
Pass the frame from the outer yield_once_2 coroutine into the
swift_coro_de/alloc functions and from there into all four de/allocation
witnesses.  This enables ABIs which key off of information stored in the
frame.
2025-10-22 21:00:17 -07:00
Nate Chandler
76881b1d52 [CoroutineAccessors] Add frame de/alloc functions.
To enable ABIs which store extra info in the frame, add two new slots to
the coroutine allocator function table.  For example, a frame could have
a header containing a context pointer at a negative offset from the
address returned from `swift_coro_alloc_frame`.  The frame deallocation
function would then know to deallocate more space correspondingly.
2025-10-22 21:00:17 -07:00
Nate Chandler
c5aa788d4b [NFC] IRGen: Refactor this code. 2025-10-22 13:00:36 -07:00
Nate Chandler
7c017fe9d9 [NFC] IRGen: Deduplicate this code. 2025-10-22 13:00:30 -07:00
Nate Chandler
f8666b164b [CoroutineAccessors] Pass cator to allocation fns.
Doing so enables allocators to contain additional context for use by
allocation functions.  Because the allocator is already passed to
_swift_coro_alloc, on the fast path (no allocator, popless) no
allocation function is used, and the allocator is passed in the
swiftcoro register, this is cheap.
2025-10-22 10:59:09 -07:00
Nate Chandler
603dc2e0b3 [CoroutineAccessors] Sign de/allocation functions.
Allocator structs are passed in to new ABI yield-once coroutines and
contain pointers to functions to de/allocate memory.  Here, those
pointers are signed.
2025-10-10 16:32:19 -07:00
Nate Chandler
5a46d84640 [NFC] IRGen: Move these functions. 2025-10-10 16:31:46 -07:00
Nate Chandler
d00b73cfae [NFC] IRGen: Refactor and deduplicate this code. 2025-10-10 16:31:46 -07:00
Nate Chandler
cd8144a794 [NFC] IRGen: Move these functions. 2025-10-10 16:28:52 -07:00
Anthony Latsis
f8577a2731 IRGen: Address llvm::Type::getPointerTo deprecation
See https://github.com/llvm/llvm-project/pull/113331.
2025-07-21 12:37:15 +01:00
Allan Shortlidge
d19d4ee99b IRGen: Use AvailabilityRange::forDeploymentTarget().
It should be preferred over querying the deployment range from the availability
domain returned by `ASTContext::getTargetAvailabilityDomain()`.

NFC.
2025-07-17 14:14:21 -07:00
Nate Chandler
cb68533649 [CoroutineAccessors] Open-code a task_dealloc_thru
When building for back-deployment, emit calls to an open-coded
`_swift_task_dealloc_through` function rather than the runtime
`swift_task_dealloc_through` which doesn't exist on them.
2025-04-03 13:45:27 -07:00