mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-10-28 19:00:52 +08:00
The old API fundamentally did not make sense, because the frontend does not track exports incrementally: it only knows the set of referenced exports at the end of each incremental update. Attempting to represent this as an incremental add/remove-style API was just a lie. It was also buggy; `deleteExport` was called from the main thread, leading to races in incremental compilation if `deleteExport` was actually implemented! We also exposed data in an unnecessarily complicated way which did not benefit most linkers. The only one which actually cared about knowing all exports for a given nav/uav upfront was the C linker (which here I have written to reconstruct that data), and even it can probably be refactored at some point to avoid that. So, replace the export API with a simpler one, where all the frontend does is tell the linker about every `Zcu.Export.Index` which is alive, just before calling `flush`. In theory this information could actually be passed into `flush`, but using a separate function made for a simpler implementation in practice. Resolves: https://github.com/ziglang/zig/issues/23616