gruel_util/place.rs
1//! Place-base shared between AIR and CFG.
2//!
3//! Both IRs represent memory locations as a base (a local slot or a
4//! parameter slot) plus a list of projections (field access, indexing).
5//! The base half is identical in both — extracted here so it isn't
6//! defined twice.
7//!
8//! The projection lists differ (AIR's `Index` carries an `AirRef`, CFG's
9//! a `CfgValue`), so those stay per-IR for now.
10
11/// Where a memory location starts: a local slot or a parameter slot.
12#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
13pub enum PlaceBase {
14 /// Local variable slot.
15 Local(u32),
16 /// Parameter slot (for parameters, including `inout`).
17 Param(u32),
18}