@@ -118,53 +118,53 @@ pub(crate) enum RegionElement {
118118
119119/// Records the CFG locations where each region is live. When we initially compute liveness, we use
120120/// an interval matrix storing liveness ranges for each region-vid.
121- pub ( crate ) struct LivenessValues < N : Idx > {
121+ pub ( crate ) struct LivenessValues {
122122 elements : Rc < RegionValueElements > ,
123- points : SparseIntervalMatrix < N , PointIndex > ,
123+ points : SparseIntervalMatrix < RegionVid , PointIndex > ,
124124}
125125
126- impl < N : Idx > LivenessValues < N > {
126+ impl LivenessValues {
127127 /// Create an empty map of regions to locations where they're live.
128128 pub ( crate ) fn new ( elements : Rc < RegionValueElements > ) -> Self {
129129 Self { points : SparseIntervalMatrix :: new ( elements. num_points ) , elements }
130130 }
131131
132132 /// Iterate through each region that has a value in this set.
133- pub ( crate ) fn regions ( & self ) -> impl Iterator < Item = N > {
133+ pub ( crate ) fn regions ( & self ) -> impl Iterator < Item = RegionVid > {
134134 self . points . rows ( )
135135 }
136136
137137 /// Records `region` as being live at the given `location`.
138- pub ( crate ) fn add_location ( & mut self , region : N , location : Location ) {
138+ pub ( crate ) fn add_location ( & mut self , region : RegionVid , location : Location ) {
139139 debug ! ( "LivenessValues::add_location(region={:?}, location={:?})" , region, location) ;
140140 let point = self . elements . point_from_location ( location) ;
141141 self . points . insert ( region, point) ;
142142 }
143143
144144 /// Records `region` as being live at all the given `points`.
145- pub ( crate ) fn add_points ( & mut self , region : N , points : & IntervalSet < PointIndex > ) {
145+ pub ( crate ) fn add_points ( & mut self , region : RegionVid , points : & IntervalSet < PointIndex > ) {
146146 debug ! ( "LivenessValues::add_points(region={:?}, points={:?})" , region, points) ;
147147 self . points . union_row ( region, points) ;
148148 }
149149
150150 /// Records `region` as being live at all the control-flow points.
151- pub ( crate ) fn add_all_points ( & mut self , region : N ) {
151+ pub ( crate ) fn add_all_points ( & mut self , region : RegionVid ) {
152152 self . points . insert_all_into_row ( region) ;
153153 }
154154
155155 /// Returns whether `region` is marked live at the given `location`.
156- pub ( crate ) fn is_live_at ( & self , region : N , location : Location ) -> bool {
156+ pub ( crate ) fn is_live_at ( & self , region : RegionVid , location : Location ) -> bool {
157157 let point = self . elements . point_from_location ( location) ;
158158 self . points . row ( region) . is_some_and ( |r| r. contains ( point) )
159159 }
160160
161161 /// Returns whether `region` is marked live at any location.
162- pub ( crate ) fn is_live_anywhere ( & self , region : N ) -> bool {
162+ pub ( crate ) fn is_live_anywhere ( & self , region : RegionVid ) -> bool {
163163 self . live_points ( region) . next ( ) . is_some ( )
164164 }
165165
166166 /// Returns an iterator of all the points where `region` is live.
167- fn live_points ( & self , region : N ) -> impl Iterator < Item = PointIndex > + ' _ {
167+ fn live_points ( & self , region : RegionVid ) -> impl Iterator < Item = PointIndex > + ' _ {
168168 self . points
169169 . row ( region)
170170 . into_iter ( )
@@ -173,7 +173,7 @@ impl<N: Idx> LivenessValues<N> {
173173 }
174174
175175 /// Returns a "pretty" string value of the region. Meant for debugging.
176- pub ( crate ) fn region_value_str ( & self , region : N ) -> String {
176+ pub ( crate ) fn region_value_str ( & self , region : RegionVid ) -> String {
177177 region_value_str (
178178 self . live_points ( region) . map ( |p| RegionElement :: Location ( self . elements . to_location ( p) ) ) ,
179179 )
@@ -309,7 +309,7 @@ impl<N: Idx> RegionValues<N> {
309309 /// `self[to] |= values[from]`, essentially: that is, take all the
310310 /// elements for the region `from` from `values` and add them to
311311 /// the region `to` in `self`.
312- pub ( crate ) fn merge_liveness < M : Idx > ( & mut self , to : N , from : M , values : & LivenessValues < M > ) {
312+ pub ( crate ) fn merge_liveness ( & mut self , to : N , from : RegionVid , values : & LivenessValues ) {
313313 if let Some ( set) = values. points . row ( from) {
314314 self . points . union_row ( to, set) ;
315315 }
0 commit comments