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

Method attach_block_param

cranelift/codegen/src/ir/dfg.rs:1345–1356  ·  view source on GitHub ↗

Append an existing value to `block`'s parameters. The appended value can't already be attached to something else. In almost all cases, you should be using `append_block_param()` instead of this method.

(&mut self, block: Block, param: Value)

Source from the content-addressed store, hash-verified

1343 ///
1344 /// In almost all cases, you should be using `append_block_param()` instead of this method.
1345 pub fn attach_block_param(&mut self, block: Block, param: Value) {
1346 debug_assert!(!self.value_is_attached(param));
1347 let num = self.blocks[block].params.push(param, &mut self.value_lists);
1348 debug_assert!(num <= u16::MAX as usize, "Too many parameters on block");
1349 let ty = self.value_type(param);
1350 self.values[param] = ValueData::Param {
1351 ty,
1352 num: num as u16,
1353 block,
1354 }
1355 .into();
1356 }
1357
1358 /// Replace a block parameter with a new value of type `ty`.
1359 ///

Callers 2

blockFunction · 0.80
replace_block_paramsFunction · 0.80

Calls 2

pushMethod · 0.45
value_typeMethod · 0.45

Tested by 2

blockFunction · 0.64
replace_block_paramsFunction · 0.64