@@ -155,18 +155,18 @@ impl<'tcx> MirPass<'tcx> for ConstProp {
155
155
}
156
156
}
157
157
158
- struct ConstPropMachine < ' mir , ' tcx > {
158
+ pub struct ConstPropMachine < ' mir , ' tcx > {
159
159
/// The virtual call stack.
160
160
stack : Vec < Frame < ' mir , ' tcx > > ,
161
161
/// `OnlyInsideOwnBlock` locals that were written in the current block get erased at the end.
162
- written_only_inside_own_block_locals : FxHashSet < Local > ,
162
+ pub written_only_inside_own_block_locals : FxHashSet < Local > ,
163
163
/// Locals that need to be cleared after every block terminates.
164
- only_propagate_inside_block_locals : BitSet < Local > ,
165
- can_const_prop : IndexVec < Local , ConstPropMode > ,
164
+ pub only_propagate_inside_block_locals : BitSet < Local > ,
165
+ pub can_const_prop : IndexVec < Local , ConstPropMode > ,
166
166
}
167
167
168
168
impl ConstPropMachine < ' _ , ' _ > {
169
- fn new (
169
+ pub fn new (
170
170
only_propagate_inside_block_locals : BitSet < Local > ,
171
171
can_const_prop : IndexVec < Local , ConstPropMode > ,
172
172
) -> Self {
@@ -816,7 +816,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
816
816
817
817
/// The mode that `ConstProp` is allowed to run in for a given `Local`.
818
818
#[ derive( Clone , Copy , Debug , PartialEq ) ]
819
- enum ConstPropMode {
819
+ pub enum ConstPropMode {
820
820
/// The `Local` can be propagated into and reads of this `Local` can also be propagated.
821
821
FullConstProp ,
822
822
/// The `Local` can only be propagated into and from its own block.
@@ -828,7 +828,7 @@ enum ConstPropMode {
828
828
NoPropagation ,
829
829
}
830
830
831
- struct CanConstProp {
831
+ pub struct CanConstProp {
832
832
can_const_prop : IndexVec < Local , ConstPropMode > ,
833
833
// False at the beginning. Once set, no more assignments are allowed to that local.
834
834
found_assignment : BitSet < Local > ,
@@ -838,7 +838,7 @@ struct CanConstProp {
838
838
839
839
impl CanConstProp {
840
840
/// Returns true if `local` can be propagated
841
- fn check < ' tcx > (
841
+ pub fn check < ' tcx > (
842
842
tcx : TyCtxt < ' tcx > ,
843
843
param_env : ParamEnv < ' tcx > ,
844
844
body : & Body < ' tcx > ,
0 commit comments