Enters a new temporary scope.
(&self)
| 472 | |
| 473 | /// Enters a new temporary scope. |
| 474 | pub(crate) fn temp_scope(&self) -> TempScope { |
| 475 | let nlocals = u8::try_from(self.symtable.locals.len()) |
| 476 | .expect("Cannot have allocated more locals than u8"); |
| 477 | TempScope { |
| 478 | base_temp: *self.next_temp.borrow(), |
| 479 | nlocals, |
| 480 | ntemps: 0, |
| 481 | next_temp: self.next_temp.clone(), |
| 482 | count_temps: self.count_temps.clone(), |
| 483 | } |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | /// A scope for temporary registers. |