MachineEnv fields are public

This commit is contained in:
Chris Fallin
2021-05-05 23:14:04 -07:00
parent 48fbc235ea
commit ab828b6c86

View File

@@ -863,10 +863,23 @@ pub enum Edit {
/// as well. /// as well.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct MachineEnv { pub struct MachineEnv {
regs: Vec<PReg>, /// Physical registers. Every register that might be mentioned in
preferred_regs_by_class: Vec<Vec<PReg>>, /// any constraint must be listed here, even if it is not
non_preferred_regs_by_class: Vec<Vec<PReg>>, /// allocatable under normal conditions.
scratch_by_class: Vec<PReg>, pub regs: Vec<PReg>,
/// Preferred physical registers for each class. These are the
/// registers that will be allocated first, if free.
pub preferred_regs_by_class: Vec<Vec<PReg>>,
/// 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<Vec<PReg>>,
/// 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<PReg>,
} }
/// The output of the register allocator. /// The output of the register allocator.