From ab828b6c86f7c00c6499bb10352d55810da1dd03 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Wed, 5 May 2021 23:14:04 -0700 Subject: [PATCH] MachineEnv fields are public --- src/lib.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) 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.