@@ -32,12 +32,6 @@ pub(super) struct SsaLocals {
32
32
borrowed_locals : BitSet < Local > ,
33
33
}
34
34
35
- pub ( super ) enum AssignedValue < ' a , ' tcx > {
36
- Arg ,
37
- Rvalue ( & ' a mut Rvalue < ' tcx > ) ,
38
- Terminator ,
39
- }
40
-
41
35
impl SsaLocals {
42
36
pub ( super ) fn new < ' tcx > (
43
37
tcx : TyCtxt < ' tcx > ,
@@ -152,37 +146,6 @@ impl SsaLocals {
152
146
} )
153
147
}
154
148
155
- pub ( super ) fn for_each_assignment_mut < ' tcx > (
156
- & self ,
157
- basic_blocks : & mut IndexSlice < BasicBlock , BasicBlockData < ' tcx > > ,
158
- mut f : impl FnMut ( Local , AssignedValue < ' _ , ' tcx > , Location ) ,
159
- ) {
160
- for & local in & self . assignment_order {
161
- match self . assignments [ local] {
162
- Set1 :: One ( DefLocation :: Argument ) => f ( local, AssignedValue :: Arg , Location {
163
- block : START_BLOCK ,
164
- statement_index : 0 ,
165
- } ) ,
166
- Set1 :: One ( DefLocation :: Assignment ( loc) ) => {
167
- let bb = & mut basic_blocks[ loc. block ] ;
168
- // `loc` must point to a direct assignment to `local`.
169
- let stmt = & mut bb. statements [ loc. statement_index ] ;
170
- let StatementKind :: Assign ( box ( target, ref mut rvalue) ) = stmt. kind else {
171
- bug ! ( )
172
- } ;
173
- assert_eq ! ( target. as_local( ) , Some ( local) ) ;
174
- f ( local, AssignedValue :: Rvalue ( rvalue) , loc)
175
- }
176
- Set1 :: One ( DefLocation :: CallReturn { call, .. } ) => {
177
- let bb = & mut basic_blocks[ call] ;
178
- let loc = Location { block : call, statement_index : bb. statements . len ( ) } ;
179
- f ( local, AssignedValue :: Terminator , loc)
180
- }
181
- _ => { }
182
- }
183
- }
184
- }
185
-
186
149
/// Compute the equivalence classes for locals, based on copy statements.
187
150
///
188
151
/// The returned vector maps each local to the one it copies. In the following case:
0 commit comments