diff --git a/src/lib.rs b/src/lib.rs index 74d462b..2031f33 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -863,10 +863,23 @@ pub enum Edit { /// as well. #[derive(Clone, Debug)] pub struct MachineEnv { - regs: Vec, - preferred_regs_by_class: Vec>, - non_preferred_regs_by_class: Vec>, - scratch_by_class: Vec, + /// Physical registers. Every register that might be mentioned in + /// any constraint must be listed here, even if it is not + /// allocatable under normal conditions. + pub regs: Vec, + /// Preferred physical registers for each class. These are the + /// registers that will be allocated first, if free. + pub preferred_regs_by_class: Vec>, + /// Non-preferred physical registers for each class. These are the + /// registers that will be allocated if a preferred register is + /// not available; using one of these is considered suboptimal, + /// but still better than spilling. + pub non_preferred_regs_by_class: Vec>, + /// One scratch register per class. This is needed to perform + /// moves between registers when cyclic move patterns occur. The + /// register should not be placed in either the preferred or + /// non-preferred list (i.e., it is not otherwise allocatable). + pub scratch_by_class: Vec, } /// The output of the register allocator.