Refactor: Move inlining logic to Inliner struct

Introduces the `Inliner` struct to encapsulate logic related to value
and function inlining. This improves code organization and readability
within the optimizer engine.

Key changes include:
- Moving `is_inlinable_value` to the `Inliner` struct.
- Extracting beta-reduction preparation logic into
  `Inliner::prepare_beta_reduction`.
- Moving parameter slot collection to
  `Inliner::collect_parameter_slots`.
- Introducing `flatten_tuple` to a new `utils` module, used by both
  `Folder` and `Inliner`.
This commit is contained in:
Michael Schimmel
2026-02-25 20:07:37 +01:00
parent 7f64e7e6ea
commit cad0c03973
5 changed files with 268 additions and 252 deletions
+3
View File
@@ -1,7 +1,10 @@
pub mod engine;
pub mod folder;
pub mod inliner;
pub mod substitution_map;
pub mod utils;
pub use engine::Optimizer;
pub use folder::Folder;
pub use inliner::Inliner;
pub use substitution_map::{SubstitutionMap, UsageInfo};