bind the value into var with Static-Single-Assignment (SSA) form. The old var is renamed and the new value stores in the new var.
(&mut self, var: VarName, sym: Symbol<T>)
| 577 | /// bind the value into var with Static-Single-Assignment (SSA) form. |
| 578 | /// The old var is renamed and the new value stores in the new var. |
| 579 | pub fn ssa_bind_value(&mut self, var: VarName, sym: Symbol<T>) -> Result<()> { |
| 580 | let old_var = self.new_ssa_var(&var)?; |
| 581 | let old_value = self.get_bind(&var).unwrap_or(sym.clone()); |
| 582 | self.bind_value(old_var, old_value)?; |
| 583 | self.bind_value(var, sym)?; |
| 584 | Ok(()) |
| 585 | } |
| 586 | |
| 587 | /// the ssa_id of old var is increased, the var is used as new var. |
| 588 | pub fn new_ssa_var(&self, var: &VarName) -> Result<VarName> { |
no test coverage detected