Builds a [TargetIsa] for the current host. ISA Flags can be overridden by passing [Value]'s via `isa_flags`.
(
infer_native_flags: bool,
flags: settings::Flags,
isa_flags: Vec<settings::Value>,
)
| 31 | /// |
| 32 | /// ISA Flags can be overridden by passing [Value]'s via `isa_flags`. |
| 33 | fn build_host_isa( |
| 34 | infer_native_flags: bool, |
| 35 | flags: settings::Flags, |
| 36 | isa_flags: Vec<settings::Value>, |
| 37 | ) -> anyhow::Result<OwnedTargetIsa> { |
| 38 | let mut builder = cranelift_native::builder_with_options(infer_native_flags) |
| 39 | .map_err(|e| anyhow::Error::msg(e))?; |
| 40 | |
| 41 | // Copy ISA Flags |
| 42 | for value in isa_flags { |
| 43 | builder.set(value.name, &value.value_string())?; |
| 44 | } |
| 45 | |
| 46 | let isa = builder.finish(flags)?; |
| 47 | Ok(isa) |
| 48 | } |
| 49 | |
| 50 | /// Checks if the host's ISA is compatible with the one requested by the test. |
| 51 | fn is_isa_compatible( |
no test coverage detected