Commit Graph

5 Commits

Author SHA1 Message Date
Araq
b4c71af517 IC: module suffix is now the trailing token of mangled C names
Reorder mangleProcNameExt and makeUnique so the module suffix comes LAST:
name_u<disamb>__<suffix> (was name__<suffix>_u<disamb>). The suffix is now a
strippable trailing token, so content-addressed cross-module merging (the
per-module backend's instance/hook dedup) can recover a mint-site-independent
name by chopping everything from the final "__" -- no reference rewriting.

Also drops the main-module special case in mangleProcNameExt: it omitted the
suffix because the main module's symbols key on its NIF-suffix file index. But
the backend already aliases that suffix to the main's source index
(nifbackend.loadModuleDependencies), so graph.ifaces[s.itemId.module] is
populated for the main module too -- the guard was redundant. Main-module
procs now mangle uniformly (e.g. mainProc_u0__<mainname>).

icFormatVersion 3 -> 4: cached .c.nif artifacts hold the old name scheme and
must be wiped.

Validated: koch boot (non-IC self-host) reaches fixed point; koch ic thallo
tconverter timp tmiscs tparseutils all green; a 3-module diamond IC build
runs correctly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 22:09:16 +02:00
Araq
efc52a5635 refactoring 2026-06-11 10:36:04 +02:00
Araq
89e8a91db4 IC: progress 2026-06-10 12:04:42 +02:00
Araq
69280d6d75 IC: progress 2026-06-08 13:51:02 +02:00
ringabout
fc48c7e615 apply the new mangle algorithm to JS backend for parameters and procs (#23476)
the function name extension encoded by paths could be useful for
debugging where the function is from

Before:
```js
function newSeq_33556909(len_33556911)
```

After:
```js
function newSeq__system_u2477(len_p0)
```
2024-04-05 08:54:48 +02:00