Construct a read-only visitor context for the values of this instruction.
(
&'dfg self,
inst: Inst,
)
| 860 | |
| 861 | /// Construct a read-only visitor context for the values of this instruction. |
| 862 | pub fn inst_values<'dfg>( |
| 863 | &'dfg self, |
| 864 | inst: Inst, |
| 865 | ) -> impl DoubleEndedIterator<Item = Value> + 'dfg { |
| 866 | self.inst_args(inst) |
| 867 | .iter() |
| 868 | .copied() |
| 869 | .chain( |
| 870 | self.insts[inst] |
| 871 | .branch_destination(&self.jump_tables, &self.exception_tables) |
| 872 | .into_iter() |
| 873 | .flat_map(|branch| { |
| 874 | branch |
| 875 | .args(&self.value_lists) |
| 876 | .filter_map(|arg| arg.as_value()) |
| 877 | }), |
| 878 | ) |
| 879 | .chain( |
| 880 | self.insts[inst] |
| 881 | .exception_table() |
| 882 | .into_iter() |
| 883 | .flat_map(|et| self.exception_tables[et].contexts()), |
| 884 | ) |
| 885 | } |
| 886 | |
| 887 | /// Map a function over the values of the instruction. |
| 888 | pub fn map_inst_values<F>(&mut self, inst: Inst, body: F) |
no test coverage detected