Completes constant emission by iterating over `self.used_constants` and filling in the "holes" with the constant values provided by `constants`. Returns the alignment required for this entire buffer. Alignment starts at the ISA's minimum function alignment and can be increased due to constant requirements.
(&mut self, constants: &VCodeConstants)
| 683 | /// at the ISA's minimum function alignment and can be increased due to |
| 684 | /// constant requirements. |
| 685 | fn finish_constants(&mut self, constants: &VCodeConstants) -> u32 { |
| 686 | let mut alignment = self.min_alignment; |
| 687 | for (constant, offset) in mem::take(&mut self.used_constants) { |
| 688 | let constant = constants.get(constant); |
| 689 | let data = constant.as_slice(); |
| 690 | self.data[offset as usize..][..data.len()].copy_from_slice(data); |
| 691 | alignment = constant.alignment().max(alignment); |
| 692 | } |
| 693 | alignment |
| 694 | } |
| 695 | |
| 696 | /// Returns a label that can be used to refer to the `constant` provided. |
| 697 | /// |