diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-12 13:33:43 -0800 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-12 13:43:19 -0800 |
| commit | fc5c2956b11e29f931cec010e3f38461ec4ac309 (patch) | |
| tree | 844337ac11e31823c488015c262604ad54b31c6b | |
| parent | 2ed25f069768c046464e68fd382c867ddb04a1e3 (diff) | |
| download | rust-fc5c2956b11e29f931cec010e3f38461ec4ac309.tar.gz rust-fc5c2956b11e29f931cec010e3f38461ec4ac309.zip | |
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
| -rw-r--r-- | src/librustc_mir/dataflow/generic/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc_mir/dataflow/generic/mod.rs b/src/librustc_mir/dataflow/generic/mod.rs index ea643042c5f..23b22550a3b 100644 --- a/src/librustc_mir/dataflow/generic/mod.rs +++ b/src/librustc_mir/dataflow/generic/mod.rs @@ -395,5 +395,16 @@ impl<T: Idx> GenKill<T> for BitSet<T> { } } +// For compatibility with old framework +impl<T: Idx> GenKill<T> for crate::dataflow::GenKillSet<T> { + fn gen(&mut self, elem: T) { + self.gen(elem); + } + + fn kill(&mut self, elem: T) { + self.kill(elem); + } +} + #[cfg(test)] mod tests; |
