Araq
b3305a6568
IC: NimMain init orchestration for the per-module backend (Phase 2b)
...
In the per-module model each module's init/datInit proc is generated by its
own cg process, but NimMain (emitted with the main module) must call them all.
Previously the main module's cg only registered its own init, so a/b's globals
stayed at their defaults -- the linked exe ran but printed wrong values.
When the cg target is the main module, register every other loaded module's
init/datInit into NimMain via registerReusedModuleToMain (exported), reading
each module's initRequired/datInitRequired from its .c.nif meta head. This is
the same no-codegen registration the whole-program backend uses for reused
TUs; it requires the main module's cg to run last, after every other .c.nif
exists (the per-module nifmake graph will order it so). Modules without init
code have no .c.nif and register nothing.
Validated: the 3-module diamond now builds end-to-end through the per-module
pipeline (cg all with main last, merge, emit all, cc, link) and the resulting
executable prints the correct "16 23" -- matching the whole-program build.
koch ic thallo green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-13 22:52:01 +02:00
..
2026-06-10 12:04:42 +02:00
2025-11-13 21:31:24 +01:00
2023-08-06 14:26:21 +02:00
2023-12-15 10:20:57 +01:00
2026-06-13 13:55:58 +02:00
2026-06-13 10:08:46 +02:00
2025-12-01 22:59:12 +01:00
2026-06-11 10:36:04 +02:00
2024-04-16 12:46:59 +02:00
2024-07-12 15:23:09 +02:00
2023-10-11 17:44:14 +02:00
2026-02-10 13:21:35 +01:00
2024-11-19 08:51:54 +01:00
2026-01-05 15:21:59 +01:00
2024-11-18 17:34:37 +01:00
2024-11-18 17:34:37 +01:00
2026-06-13 10:08:46 +02:00
2026-06-13 22:49:13 +02:00
2026-04-27 18:00:29 +02:00
2022-11-30 21:51:13 +01:00
2025-10-06 21:55:31 +02:00
2026-06-11 21:51:59 +02:00
2024-11-18 17:34:37 +01:00
2024-11-18 17:34:37 +01:00
2026-06-13 22:49:13 +02:00
2026-06-13 22:09:16 +02:00
2026-06-13 22:52:01 +02:00
2026-06-12 12:47:06 +02:00
2026-06-12 16:27:41 +02:00
2026-03-16 16:56:18 +01:00
2024-03-28 11:04:12 +01:00
2026-06-13 22:49:13 +02:00
2026-06-13 21:03:55 +02:00
2023-06-18 16:06:14 +02:00
2025-12-31 13:33:57 +01:00
2026-02-01 17:06:33 +01:00
2026-06-12 06:05:31 +02:00
2017-01-07 22:35:09 +01:00
2022-06-10 20:40:08 +02:00
2023-10-29 14:48:11 +01:00
2026-06-13 20:50:11 +02:00
2026-02-10 13:21:35 +01:00
2023-08-06 14:26:21 +02:00
2026-03-27 10:20:10 +01:00
2026-06-12 12:47:06 +02:00
2023-11-20 21:12:13 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2024-08-28 20:46:36 +02:00
2025-07-14 23:14:06 +02:00
2023-10-29 14:48:11 +01:00
2023-10-29 14:48:11 +01:00
2023-10-29 14:48:11 +01:00
2026-05-27 23:29:27 +02:00
2025-11-21 21:26:43 +01:00
2026-06-13 10:16:29 +02:00
2023-10-29 14:48:11 +01:00
2026-05-08 06:50:13 +02:00
2020-06-01 19:21:41 +02:00
2026-06-07 19:55:56 +02:00
2025-11-25 12:49:23 +01:00
2025-10-13 13:47:06 +02:00
2026-04-02 07:19:43 +02:00
2024-12-27 19:42:18 +01:00
2026-06-11 10:36:04 +02:00
2026-04-18 09:40:55 +02:00
2025-07-14 23:15:44 +02:00
2026-06-13 10:08:46 +02:00
2026-04-02 07:19:43 +02:00
2023-12-13 10:39:10 +01:00
2026-05-18 07:55:33 +02:00
2026-06-13 20:21:30 +02:00
2025-12-11 18:22:38 +01:00
2026-06-08 09:00:00 +02:00
2026-01-23 22:50:00 +01:00
2026-04-02 07:19:43 +02:00
2026-06-13 10:08:46 +02:00
2026-06-11 10:36:04 +02:00
2021-01-12 09:36:51 +01:00
2026-03-07 07:39:57 +01:00
2026-06-12 16:27:41 +02:00
2026-06-13 22:09:16 +02:00
2026-06-13 10:08:46 +02:00
2026-01-09 13:10:04 +01:00
2026-06-11 10:36:04 +02:00
2026-06-10 12:04:42 +02:00
2026-06-13 22:52:01 +02:00
2026-02-07 20:46:50 +01:00
2026-06-08 09:00:00 +02:00
2026-04-28 18:48:41 +02:00
2026-06-10 12:04:42 +02:00
2023-12-15 08:13:25 +01:00
2026-06-13 10:08:46 +02:00
2025-11-13 21:31:24 +01:00
2023-10-29 14:48:11 +01:00
2023-10-29 14:48:11 +01:00
2025-12-11 18:22:38 +01:00
2023-10-29 14:48:11 +01:00
2024-08-12 15:33:26 +02:00
2023-04-17 20:55:22 +02:00
2025-04-03 12:54:00 +02:00
2026-06-13 22:49:13 +02:00
2023-08-06 14:26:21 +02:00
2025-11-13 21:31:24 +01:00
2025-09-24 06:29:57 +02:00
2026-06-09 16:12:38 +02:00
2022-08-24 09:44:16 +02:00
2026-01-16 12:19:17 +01:00
2023-10-29 14:48:11 +01:00
2025-04-12 08:39:11 +02:00
2026-06-13 13:55:58 +02:00
2026-06-12 06:05:31 +02:00
2025-10-13 13:47:06 +02:00
2018-05-27 19:19:12 +02:00
2026-02-10 13:21:35 +01:00
2023-10-29 14:48:11 +01:00
2024-04-10 14:41:16 +02:00
2024-09-03 09:19:52 +02:00
2023-07-02 22:36:05 +02:00
2026-04-16 09:44:58 +02:00
2023-10-29 14:48:11 +01:00
2025-04-12 08:39:11 +02:00
2023-11-06 18:33:28 +01:00
2023-08-10 14:26:40 +02:00
2020-09-11 01:04:07 +02:00
2026-02-10 00:04:11 +01:00
2026-02-10 13:21:35 +01:00
2026-06-10 12:04:42 +02:00
2026-06-13 13:55:58 +02:00
2026-06-13 10:08:46 +02:00
2025-12-11 18:22:38 +01:00
2026-06-10 12:04:42 +02:00
2026-06-08 08:55:37 +02:00
2026-06-13 10:08:46 +02:00
2025-12-11 18:22:38 +01:00
2026-05-05 20:21:37 +02:00
2026-05-05 21:05:17 +02:00
2025-12-11 18:22:38 +01:00
2026-06-02 07:07:44 +02:00
2026-06-08 09:00:00 +02:00
2022-12-11 16:58:50 +01:00
2026-01-16 12:19:17 +01:00
2026-06-13 10:08:46 +02:00
2026-06-13 10:08:46 +02:00
2026-06-10 12:04:42 +02:00
2026-06-13 10:08:46 +02:00
2025-12-26 21:59:38 +01:00
2025-12-11 18:22:38 +01:00
2024-03-16 08:35:18 +08:00
2026-05-21 13:42:38 +02:00
2025-12-29 13:52:22 +01:00
2025-07-18 08:44:36 +02:00
2024-04-10 14:41:16 +02:00
2023-08-10 14:26:40 +02:00
2026-06-08 08:53:10 +02:00
2025-04-12 08:39:11 +02:00
2025-12-31 13:33:57 +01:00
2026-03-30 15:09:11 +02:00
2026-06-13 10:08:46 +02:00
2026-05-29 07:58:23 +02:00
2023-10-29 14:48:11 +01:00
2026-06-03 07:25:33 +02:00
2026-06-12 09:50:23 +02:00
2023-12-12 16:54:50 +01:00
2025-12-25 00:04:18 +01:00
2026-03-09 11:59:12 +01:00
2026-06-13 10:08:46 +02:00
2023-08-10 14:26:40 +02:00
2024-04-10 14:41:16 +02:00
2026-06-09 16:12:38 +02:00
2025-11-13 21:31:24 +01:00
2026-06-05 16:37:00 +02:00
2023-12-25 07:12:54 +01:00