Skip to content

Commit fc5c295

Browse files
Impl GenKill for old dataflow framework's GenKillSet
This impl is temporary and will be removed along with the old dataflow framework. It allows us to reuse the transfer function of new dataflow analyses when defining old ones
1 parent 2ed25f0 commit fc5c295

File tree

1 file changed

+11
-0
lines changed
  • src/librustc_mir/dataflow/generic

1 file changed

+11
-0
lines changed

src/librustc_mir/dataflow/generic/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,5 +395,16 @@ impl<T: Idx> GenKill<T> for BitSet<T> {
395395
}
396396
}
397397

398+
// For compatibility with old framework
399+
impl<T: Idx> GenKill<T> for crate::dataflow::GenKillSet<T> {
400+
fn gen(&mut self, elem: T) {
401+
self.gen(elem);
402+
}
403+
404+
fn kill(&mut self, elem: T) {
405+
self.kill(elem);
406+
}
407+
}
408+
398409
#[cfg(test)]
399410
mod tests;

0 commit comments

Comments
 (0)