@@ -2,15 +2,15 @@ use crate::liveness::{LiveNode, Variable};
2
2
use std:: iter;
3
3
4
4
#[ derive( Clone , Copy ) ]
5
- pub ( super ) struct RWU {
6
- pub ( super ) reader : bool ,
7
- pub ( super ) writer : bool ,
8
- pub ( super ) used : bool ,
5
+ pub struct RWU {
6
+ pub reader : bool ,
7
+ pub writer : bool ,
8
+ pub used : bool ,
9
9
}
10
10
11
11
/// Conceptually, this is like a `Vec<Vec<RWU>>`. But the number of
12
12
/// RWU`s can get very large, so it uses a more compact representation.
13
- pub ( super ) struct RWUTable {
13
+ pub struct RWUTable {
14
14
/// Total number of live nodes.
15
15
live_nodes : usize ,
16
16
/// Total number of variables.
@@ -42,7 +42,7 @@ impl RWUTable {
42
42
/// Number of packed RWUs that fit into a single word.
43
43
const WORD_RWU_COUNT : usize = Self :: WORD_BITS / Self :: RWU_BITS ;
44
44
45
- pub ( super ) fn new ( live_nodes : usize , vars : usize ) -> RWUTable {
45
+ pub fn new ( live_nodes : usize , vars : usize ) -> RWUTable {
46
46
let live_node_words = ( vars + Self :: WORD_RWU_COUNT - 1 ) / Self :: WORD_RWU_COUNT ;
47
47
Self { live_nodes, vars, live_node_words, words : vec ! [ 0u8 ; live_node_words * live_nodes] }
48
48
}
@@ -74,7 +74,7 @@ impl RWUTable {
74
74
}
75
75
}
76
76
77
- pub ( super ) fn copy ( & mut self , dst : LiveNode , src : LiveNode ) {
77
+ pub fn copy ( & mut self , dst : LiveNode , src : LiveNode ) {
78
78
if dst == src {
79
79
return ;
80
80
}
@@ -85,7 +85,7 @@ impl RWUTable {
85
85
86
86
/// Sets `dst` to the union of `dst` and `src`, returns true if `dst` was
87
87
/// changed.
88
- pub ( super ) fn union ( & mut self , dst : LiveNode , src : LiveNode ) -> bool {
88
+ pub fn union ( & mut self , dst : LiveNode , src : LiveNode ) -> bool {
89
89
if dst == src {
90
90
return false ;
91
91
}
@@ -101,22 +101,22 @@ impl RWUTable {
101
101
changed
102
102
}
103
103
104
- pub ( super ) fn get_reader ( & self , ln : LiveNode , var : Variable ) -> bool {
104
+ pub fn get_reader ( & self , ln : LiveNode , var : Variable ) -> bool {
105
105
let ( word, shift) = self . word_and_shift ( ln, var) ;
106
106
( self . words [ word] >> shift) & Self :: RWU_READER != 0
107
107
}
108
108
109
- pub ( super ) fn get_writer ( & self , ln : LiveNode , var : Variable ) -> bool {
109
+ pub fn get_writer ( & self , ln : LiveNode , var : Variable ) -> bool {
110
110
let ( word, shift) = self . word_and_shift ( ln, var) ;
111
111
( self . words [ word] >> shift) & Self :: RWU_WRITER != 0
112
112
}
113
113
114
- pub ( super ) fn get_used ( & self , ln : LiveNode , var : Variable ) -> bool {
114
+ pub fn get_used ( & self , ln : LiveNode , var : Variable ) -> bool {
115
115
let ( word, shift) = self . word_and_shift ( ln, var) ;
116
116
( self . words [ word] >> shift) & Self :: RWU_USED != 0
117
117
}
118
118
119
- pub ( super ) fn get ( & self , ln : LiveNode , var : Variable ) -> RWU {
119
+ pub fn get ( & self , ln : LiveNode , var : Variable ) -> RWU {
120
120
let ( word, shift) = self . word_and_shift ( ln, var) ;
121
121
let rwu_packed = self . words [ word] >> shift;
122
122
RWU {
@@ -126,7 +126,7 @@ impl RWUTable {
126
126
}
127
127
}
128
128
129
- pub ( super ) fn set ( & mut self , ln : LiveNode , var : Variable , rwu : RWU ) {
129
+ pub fn set ( & mut self , ln : LiveNode , var : Variable , rwu : RWU ) {
130
130
let mut packed = 0 ;
131
131
if rwu. reader {
132
132
packed |= Self :: RWU_READER ;
0 commit comments