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

Function lower_variant

crates/test-util/src/component_fuzz.rs:653–670  ·  view source on GitHub ↗
(types: impl Iterator<Item = Option<&'a Type>>, vec: &mut Vec<CoreType>)

Source from the content-addressed store, hash-verified

651}
652
653fn lower_variant<'a>(types: impl Iterator<Item = Option<&'a Type>>, vec: &mut Vec<CoreType>) {
654 vec.push(CoreType::I32);
655 let offset = vec.len();
656 for ty in types {
657 let ty = match ty {
658 Some(ty) => ty,
659 None => continue,
660 };
661 for (index, ty) in ty.lowered().iter().enumerate() {
662 let index = offset + index;
663 if index < vec.len() {
664 vec[index] = vec[index].join(*ty);
665 } else {
666 vec.push(*ty)
667 }
668 }
669 }
670}
671
672fn u32_count_from_flag_count(count: usize) -> usize {
673 match FlagsSize::from_count(count) {

Callers 1

lowerMethod · 0.85

Calls 5

loweredMethod · 0.80
pushMethod · 0.45
lenMethod · 0.45
iterMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected