Commit Graph

3 Commits

Author SHA1 Message Date
Felipe de Azevedo Piovezan d3d7c555b1 [EmitAsyncEntryReturnMetadata] Emit sections for all async funclets
This builds upon previous work, which created a section for async entry
funclets and a section for async exit funclets, to also create a section
for all other funclets, allowing tools to identify any async funclet.

Depends on:
* https://github.com/swiftlang/llvm-project/pull/12303

rdar://146656133
2026-02-09 17:20:25 +00:00
Ben Barham 565645723d [rebranch] Add another missing llvm/IR/Module.h include
More `Module.h`.
2024-09-16 16:18:12 -07:00
Arnold Schwaighofer eaf90dff38 IRGen: Add metadata for async funclets denoting frame entry and frame exists
Adds sections `__TEXT,__swift_as_entry`, and `__TEXT,__swift_as_ret` that
contain relative pointers to async functlets modelling async function entries,
and function returns, respectively.

Emission of the sections can be trigger with the frontend option
`-Xfrontend -enable-async-frame-push-pop-metadata`.

This is done by:

* IRGen adding a `async_entry` function attribute to async functions.
* LLVM's coroutine splitting identifying continuation funclets that
  model the return from an async function call by adding the function
  attribute `async_ret`.  (see #llvm-project/pull/9204)
* An LLVM pass that keys off these two function attribute and emits the
  metadata into the above mention sections.

rdar://134460666
2024-09-03 08:44:16 -07:00