Create a reverse-alias map from a value to all aliases having that value as a direct target
(func: &Function)
| 161 | |
| 162 | /// Create a reverse-alias map from a value to all aliases having that value as a direct target |
| 163 | fn alias_map(func: &Function) -> SecondaryMap<Value, Vec<Value>> { |
| 164 | let mut aliases = SecondaryMap::<_, Vec<_>>::new(); |
| 165 | for v in func.dfg.values() { |
| 166 | // VADFS returns the immediate target of an alias |
| 167 | if let Some(k) = func.dfg.value_alias_dest_for_serialization(v) { |
| 168 | aliases[k].push(v); |
| 169 | } |
| 170 | } |
| 171 | aliases |
| 172 | } |
| 173 | |
| 174 | /// Writes `func` to `w` as text. |
| 175 | /// write_function_plain is passed as 'closure' to print instructions as text. |
no test coverage detected