Return an `isa` builder configured for the current host machine, or `Err(())` if the host machine is not supported in the current configuration. Selects the given backend variant specifically; this is useful when more than one backend exists for a given target (e.g., on x86-64).
(infer_native_flags: bool)
| 25 | /// useful when more than one backend exists for a given target |
| 26 | /// (e.g., on x86-64). |
| 27 | pub fn builder_with_options(infer_native_flags: bool) -> Result<isa::Builder, &'static str> { |
| 28 | let mut isa_builder = isa::lookup(Triple::host()).map_err(|err| match err { |
| 29 | isa::LookupError::SupportDisabled => "support for architecture disabled at compile time", |
| 30 | isa::LookupError::Unsupported => "unsupported architecture", |
| 31 | })?; |
| 32 | if infer_native_flags { |
| 33 | self::infer_native_flags(&mut isa_builder)?; |
| 34 | } |
| 35 | Ok(isa_builder) |
| 36 | } |
| 37 | |
| 38 | /// Return an `isa` builder configured for the current host |
| 39 | /// machine, or `Err(())` if the host machine is not supported |