Summary
MIR must keep storage projection separate from value access before arrays, slices, maps, and deeper addressable composite paths land.
First slice is implemented in #34:
- replaces tactical
FieldAddr with ProjectField
- replaces
StoreField with generic pointer Store
- adds explicit
Load for pointer-backed field reads
- makes
@box.field, box.field, and box.field = value share field projection logic
Problem
MIR used to mix place computation and value access:
Field was value-producing.
StoreField was a special write path.
- Address-of field needed a one-off
FieldAddr bridge to avoid LLVM pointer-to-copy temps.
That shape does not scale to arrays, slices, maps, nested fields, deref/index chains, or future addressability rules.
Direction
Continue pivoting MIR to projection/place form:
- represent storage locations as projections, e.g. field, index, deref/local base
- make reads explicit with
Load(place)
- make writes explicit with
Store(place, value)
- make address-of reuse place/projection computation instead of one-off address nodes
Current field slice spelling:
box.field through pointer -> Load(ProjectField(box, field))
@box.field -> ProjectField(box, field)
box.field = value -> Store(ProjectField(box, field), value)
Hard Line
Do not add future one-off address nodes:
- no
IndexAddr
- no
SliceAddr
- no
MapAddr
Arrays, slices, and maps must extend the projection/place path instead.
Remaining Acceptance Criteria
- Add non-field projections needed by arrays/slices before indexing lands.
- Keep backend GEP/load/store logic shared instead of duplicated by composite kind.
- Make map element addressability policy explicit before map lowering lands.
- Decide whether MIR keeps projection nodes directly or grows a fuller
Place model.
PRs
Summary
MIR must keep storage projection separate from value access before arrays, slices, maps, and deeper addressable composite paths land.
First slice is implemented in #34:
FieldAddrwithProjectFieldStoreFieldwith generic pointerStoreLoadfor pointer-backed field reads@box.field,box.field, andbox.field = valueshare field projection logicProblem
MIR used to mix place computation and value access:
Fieldwas value-producing.StoreFieldwas a special write path.FieldAddrbridge to avoid LLVM pointer-to-copy temps.That shape does not scale to arrays, slices, maps, nested fields, deref/index chains, or future addressability rules.
Direction
Continue pivoting MIR to projection/place form:
Load(place)Store(place, value)Current field slice spelling:
box.fieldthrough pointer ->Load(ProjectField(box, field))@box.field->ProjectField(box, field)box.field = value->Store(ProjectField(box, field), value)Hard Line
Do not add future one-off address nodes:
IndexAddrSliceAddrMapAddrArrays, slices, and maps must extend the projection/place path instead.
Remaining Acceptance Criteria
Placemodel.PRs