MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / build_host_isa

Function build_host_isa

cranelift/filetests/src/test_run.rs:33–48  ·  view source on GitHub ↗

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>,
)

Source from the content-addressed store, hash-verified

31///
32/// ISA Flags can be overridden by passing [Value]'s via `isa_flags`.
33fn 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.
51fn is_isa_compatible(

Callers 2

compile_testfileFunction · 0.85
run_targetMethod · 0.85

Calls 6

builder_with_optionsFunction · 0.85
msgFunction · 0.85
OkFunction · 0.85
value_stringMethod · 0.80
setMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected