mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
The partitions of a program build have no locals for ThinLTO to promote: symbols that other partitions refer to are already hidden. What changed the modules after importing, and with them the object cache keys, of partitions an edit did not touch was the numbering of struct types. Every partition declares the program's types under the same names, and the thin link loads the importing partition and the partitions it imports from into one context, which tells same-named types apart by appending a counter that runs across the whole link. An edit that adds a type anywhere shifted the counter. Partitions now drop the names of their struct types before their summary is written; importing matches unnamed types by their bodies. The promoted-locals option, the per-partition source file name and the partition index in the summary key are removed.