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

Method from_target_isa

cranelift/codegen/src/isa/mod.rs:195–207  ·  view source on GitHub ↗

Creates a new [Builder] from a [TargetIsa], copying all flags in the process.

(target_isa: &dyn TargetIsa)

Source from the content-addressed store, hash-verified

193 /// Creates a new [Builder] from a [TargetIsa], copying all flags in the
194 /// process.
195 pub fn from_target_isa(target_isa: &dyn TargetIsa) -> Builder {
196 // We should always be able to find the builder for the TargetISA, since presumably we
197 // also generated the previous TargetISA at some point
198 let triple = target_isa.triple().clone();
199 let mut builder = self::lookup(triple).expect("Could not find triple for target ISA");
200
201 // Copy ISA Flags
202 for flag in target_isa.isa_flags() {
203 builder.set(&flag.name, &flag.value_string()).unwrap();
204 }
205
206 builder
207 }
208
209 /// Gets the triple for the builder.
210 pub fn triple(&self) -> &Triple {

Callers

nothing calls this directly

Calls 8

value_stringMethod · 0.80
lookupFunction · 0.70
cloneMethod · 0.45
tripleMethod · 0.45
expectMethod · 0.45
isa_flagsMethod · 0.45
unwrapMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected