4 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
40dabefdb4 Reapply: Runtime: expose demangle() in Runtime module (#84788) (#86510) 2026-01-14 21:44:28 +09:00
eeckstein
4766678f3f Revert "Runtime: expose demangle() in Runtime module (#84788)"
This reverts commit ab69fc0d2c.
2026-01-12 10:26:14 +01:00
Konrad `ktoso` Malawski
ab69fc0d2c Runtime: expose demangle() in Runtime module (#84788)
We should expose the demangle functionality; It's been widely used by
calling into internal _swift_demangle and instead we should offer a real
API. It's also already used in the Runtime module already when forming
backtraces.

[Previous
discussions](https://forums.swift.org/t/demangle-function/25416/15)
happened between 2019 and 2024, and just never materialized in a
complete implementation and proposal.

Right now, even more tools are in need of this API, as we are building
continious profiling solutions etc, so it is a good time to revisit this
topic.

This PR is roughly based off @Azoy's

https://github.com/swiftlang/swift/pull/25314/files#diff-fd379a721cc9a1c9ef6486eae713e945da842b42170d4d069029a57334371eba
from 2019, however it brings it over to the new Runtime module which is
a great place to put this functionality - even Backtrace had to recently
reinvent calling the demangling infra in this module.

Pending SE review, [proposal
here](https://github.com/swiftlang/swift-evolution/pull/2989).

cc @azoy @al45tair

---------

Co-authored-by: Alastair Houghton <alastair@alastairs-place.net>
2026-01-09 09:46:19 -08:00
Alastair Houghton
760cc57bef [Backtracing] Rename _Backtracing to Runtime.
Move the backtracing code into a new Runtime module.  This means renaming
the Swift Runtime's CMake target because otherwise there will be a name
clash.

rdar://124913332
2025-01-17 10:09:36 +00:00