| 1452 | /// Panics if this configuration's compiler was [disabled][Config::enable_compiler]. |
| 1453 | #[cfg(any(feature = "cranelift", feature = "winch"))] |
| 1454 | pub fn cranelift_opt_level(&mut self, level: OptLevel) -> &mut Self { |
| 1455 | let val = match level { |
| 1456 | OptLevel::None => "none", |
| 1457 | OptLevel::Speed => "speed", |
| 1458 | OptLevel::SpeedAndSize => "speed_and_size", |
| 1459 | }; |
| 1460 | self.compiler_config_mut() |
| 1461 | .settings |
| 1462 | .insert("opt_level".to_string(), val.to_string()); |
| 1463 | self |
| 1464 | } |
| 1465 | |
| 1466 | /// Configures the regalloc algorithm used by the Cranelift code generator. |
| 1467 | /// |