Skip to main content

oxilean_codegen/opt_dce/
dceconfig_traits.rs

1//! # DceConfig - Trait Implementations
2//!
3//! This module contains trait implementations for `DceConfig`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Default`
8//! - `Display`
9//!
10//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
11
12use crate::lcnf::*;
13
14use super::types::DceConfig;
15use std::fmt;
16
17impl Default for DceConfig {
18    fn default() -> Self {
19        DceConfig {
20            eliminate_unused_lets: true,
21            eliminate_unreachable_alts: true,
22            propagate_constants: true,
23            propagate_copies: true,
24            fold_known_calls: true,
25            max_iterations: 10,
26        }
27    }
28}
29
30impl fmt::Display for DceConfig {
31    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
32        write!(
33            f,
34            "DceConfig {{ unused_lets={}, unreachable_alts={}, const_prop={}, \
35             copy_prop={}, fold_known={}, max_iter={} }}",
36            self.eliminate_unused_lets,
37            self.eliminate_unreachable_alts,
38            self.propagate_constants,
39            self.propagate_copies,
40            self.fold_known_calls,
41            self.max_iterations,
42        )
43    }
44}