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)
| 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 | /// |