Commit Graph

1 Commits

Author SHA1 Message Date
Brummel 84ba83dda3 codegen tidy: extract pure helpers into synth.rs + subst.rs
First slice of the codegen module split. Pulls the run of
free functions at the bottom of lib.rs into two purpose-named
submodules, with no behaviour change:

- synth.rs (216 lines): LLVM-IR shaping helpers — llvm_type,
  fn_sig_from_type, builtin_ail_type, builtin_effect_op_ret,
  type_descriptor, builtin_binop, c_byte_len, default_triple,
  ll_string_literal.

- subst.rs (319 lines): monomorphisation pipeline — the
  derive_substitution + unify_for_subst + apply_subst_to_*
  family, plus qualify_local_types_codegen and
  descriptor_for_subst.

lib.rs drops from 5295 → 4800 lines. Visibility is unchanged
(submodules see lib.rs's private Result/CodegenError/FnSig
through normal Rust scoping); call sites are unchanged in
behaviour, only re-imported via 'use' at the lib.rs head.

Motivation is the codebase-control conversation: lib.rs was
the one navigability outlier flagged in the size sanity-
check, and the 18g family closing left a clean window before
the next iter. The remaining bulk (drop emission, match
lowering, lambda lowering) will come out in follow-up
commits, each an independent move-only refactor with full
cargo test --workspace between.
2026-05-08 15:41:04 +02:00