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

Method default_byte

cranelift/codegen/meta/src/cdsl/settings.rs:30–46  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

28
29impl Setting {
30 pub fn default_byte(&self) -> u8 {
31 match self.specific {
32 SpecificSetting::Bool(BoolSetting {
33 default,
34 bit_offset,
35 ..
36 }) => {
37 if default {
38 1 << bit_offset
39 } else {
40 0
41 }
42 }
43 SpecificSetting::Enum(_) => 0,
44 SpecificSetting::Num(default) => default,
45 }
46 }
47
48 fn byte_for_value(&self, v: bool) -> u8 {
49 match self.specific {

Callers 1

gen_templateFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected