refactor(tvix/eval): always pass slot to compiler methods

The slot is now always known (at the root of the file it is simply
stack slot 0 once the scope drops back down to 0), so it does not need
to be wrapped in an `Option` and accessed in cumbersome ways anymore.

Change-Id: I46bf67a4cf5cb96e4874dffd0e3fb07c551d44f0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6420
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-09-02 01:29:39 +03:00 committed by tazjin
parent a303ea3ff5
commit 7bc6e5984d
2 changed files with 32 additions and 33 deletions

View file

@ -104,6 +104,10 @@ pub struct Upvalue {
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)]
pub struct LocalIdx(usize);
impl LocalIdx {
pub const ZERO: LocalIdx = LocalIdx(0);
}
/// Represents a scope known during compilation, which can be resolved
/// directly to stack indices.
///