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

Function create_constants

cranelift/codegen/src/inline.rs:1627–1632  ·  view source on GitHub ↗

Copy constants from the callee into the caller.

(allocs: &mut InliningAllocs, func: &mut ir::Function, callee: &ir::Function)

Source from the content-addressed store, hash-verified

1625
1626/// Copy constants from the callee into the caller.
1627fn create_constants(allocs: &mut InliningAllocs, func: &mut ir::Function, callee: &ir::Function) {
1628 for (callee_constant, data) in callee.dfg.constants.iter() {
1629 let inlined_constant = func.dfg.constants.insert(data.clone());
1630 allocs.constants[*callee_constant] = Some(inlined_constant).into();
1631 }
1632}

Callers 1

create_entitiesFunction · 0.85

Calls 3

iterMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected