diff --git a/cranelift/codegen/src/isa/mod.rs b/cranelift/codegen/src/isa/mod.rs index 069324f040..8de000409f 100644 --- a/cranelift/codegen/src/isa/mod.rs +++ b/cranelift/codegen/src/isa/mod.rs @@ -111,9 +111,9 @@ macro_rules! isa_builder { }}; } -/// Look for an ISA for the given `triple`, selecting the backend variant given -/// by `variant` if available. -pub fn lookup_variant(triple: Triple) -> Result { +/// Look for an ISA for the given `triple`. +/// Return a builder that can create a corresponding `TargetIsa`. +pub fn lookup(triple: Triple) -> Result { match triple.architecture { Architecture::X86_64 => { isa_builder!(x64, (feature = "x86"), triple) @@ -125,12 +125,6 @@ pub fn lookup_variant(triple: Triple) -> Result { } } -/// Look for an ISA for the given `triple`. -/// Return a builder that can create a corresponding `TargetIsa`. -pub fn lookup(triple: Triple) -> Result { - lookup_variant(triple) -} - /// Look for a supported ISA with the given `name`. /// Return a builder that can create a corresponding `TargetIsa`. pub fn lookup_by_name(name: &str) -> Result { diff --git a/cranelift/native/src/lib.rs b/cranelift/native/src/lib.rs index c2a5aa78b8..c80898a24b 100644 --- a/cranelift/native/src/lib.rs +++ b/cranelift/native/src/lib.rs @@ -41,7 +41,7 @@ pub fn builder() -> Result { /// useful when more than oen backend exists for a given target /// (e.g., on x86-64). pub fn builder_with_options(infer_native_flags: bool) -> Result { - let mut isa_builder = isa::lookup_variant(Triple::host()).map_err(|err| match err { + let mut isa_builder = isa::lookup(Triple::host()).map_err(|err| match err { isa::LookupError::SupportDisabled => "support for architecture disabled at compile time", isa::LookupError::Unsupported => "unsupported architecture", })?; diff --git a/cranelift/reader/src/parser.rs b/cranelift/reader/src/parser.rs index 98c46ab2e3..1daa593501 100644 --- a/cranelift/reader/src/parser.rs +++ b/cranelift/reader/src/parser.rs @@ -1159,7 +1159,7 @@ impl<'a> Parser<'a> { Ok(triple) => triple, Err(err) => return err!(loc, err), }; - let mut isa_builder = match isa::lookup_variant(triple) { + let mut isa_builder = match isa::lookup(triple) { Err(isa::LookupError::SupportDisabled) => { continue; }