use crate::ir::ir_variable::IrVariableId; use crate::ir::register_allocation::VrUser; use std::collections::HashSet; use std::fmt::{Display, Formatter}; pub struct IrReadField { field_ref_variable: IrVariableId, } impl IrReadField { pub fn new(field_ref_variable: IrVariableId) -> Self { Self { field_ref_variable } } pub fn field_ref_variable(&self) -> IrVariableId { self.field_ref_variable } } impl VrUser for IrReadField { fn vr_uses(&self) -> HashSet { HashSet::from([self.field_ref_variable]) } } impl Display for IrReadField { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { write!(f, "IrReadField({})", self.field_ref_variable) } }