Skip to content

Commit ab828b6

Browse files
committed
MachineEnv fields are public
1 parent 48fbc23 commit ab828b6

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/lib.rs

+17-4
Original file line numberDiff line numberDiff line change
@@ -863,10 +863,23 @@ pub enum Edit {
863863
/// as well.
864864
#[derive(Clone, Debug)]
865865
pub struct MachineEnv {
866-
regs: Vec<PReg>,
867-
preferred_regs_by_class: Vec<Vec<PReg>>,
868-
non_preferred_regs_by_class: Vec<Vec<PReg>>,
869-
scratch_by_class: Vec<PReg>,
866+
/// Physical registers. Every register that might be mentioned in
867+
/// any constraint must be listed here, even if it is not
868+
/// allocatable under normal conditions.
869+
pub regs: Vec<PReg>,
870+
/// Preferred physical registers for each class. These are the
871+
/// registers that will be allocated first, if free.
872+
pub preferred_regs_by_class: Vec<Vec<PReg>>,
873+
/// Non-preferred physical registers for each class. These are the
874+
/// registers that will be allocated if a preferred register is
875+
/// not available; using one of these is considered suboptimal,
876+
/// but still better than spilling.
877+
pub non_preferred_regs_by_class: Vec<Vec<PReg>>,
878+
/// One scratch register per class. This is needed to perform
879+
/// moves between registers when cyclic move patterns occur. The
880+
/// register should not be placed in either the preferred or
881+
/// non-preferred list (i.e., it is not otherwise allocatable).
882+
pub scratch_by_class: Vec<PReg>,
870883
}
871884

872885
/// The output of the register allocator.

0 commit comments

Comments
 (0)