Derive record-io construction wiring from the intent IR

This commit is contained in:
Dennis Kobert
2026-08-13 23:26:22 +00:00
parent c82093f153
commit 20ba069fe0
2 changed files with 115 additions and 116 deletions

View File

@@ -166,11 +166,11 @@ pub(crate) fn lazy_read_fields<'a>(regular_fields: &[&'a ParsedField]) -> Vec<(u
/// The indices (into the unit-skipped regular fields) of value inputs whose
/// reads resolve against their own wire rather than the carrier's.
pub(crate) fn reading_secondary_indices(regular_fields: &[&ParsedField], shape: &RecordShape) -> Vec<usize> {
pub(crate) fn reading_secondary_indices(regular_fields: &[&ParsedField], skips_carrier: bool) -> Vec<usize> {
regular_fields
.iter()
.enumerate()
.filter(|(index, field)| !field.attribute_reads.is_empty() && (shape.skips_carrier() || *index != 0))
.filter(|(index, field)| !field.attribute_reads.is_empty() && (skips_carrier || *index != 0))
.map(|(index, _)| index)
.collect()
}