diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-09-27 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2020-09-27 00:00:00 +0000 |
| commit | d68aa227c6b7ab9c1cfa003e752c3600a7269485 (patch) | |
| tree | 7362d485e134281aee8b182374b8458f1ad54e6e /compiler | |
| parent | 57d38975cc638bcdeb7e9bcd10621615e8f9f3c0 (diff) | |
| download | rust-d68aa227c6b7ab9c1cfa003e752c3600a7269485.tar.gz rust-d68aa227c6b7ab9c1cfa003e752c3600a7269485.zip | |
liveness: Access live nodes directly through self.lnks[ln]
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_passes/src/liveness.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs index 8c6d47f992d..9eac2f79e41 100644 --- a/compiler/rustc_passes/src/liveness.rs +++ b/compiler/rustc_passes/src/liveness.rs @@ -302,10 +302,6 @@ impl IrMaps<'tcx> { fn set_captures(&mut self, hir_id: HirId, cs: Vec<CaptureInfo>) { self.capture_info_map.insert(hir_id, Rc::new(cs)); } - - fn lnk(&self, ln: LiveNode) -> LiveNodeKind { - self.lnks[ln] - } } fn visit_fn<'tcx>( @@ -691,7 +687,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { fn live_on_entry(&self, ln: LiveNode, var: Variable) -> Option<LiveNodeKind> { assert!(ln.is_valid()); let reader = self.rwu_table.get_reader(self.idx(ln, var)); - if reader.is_valid() { Some(self.ir.lnk(reader)) } else { None } + if reader.is_valid() { Some(self.ir.lnks[reader]) } else { None } } // Is this variable live on entry to any of its successor nodes? @@ -708,7 +704,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { fn assigned_on_entry(&self, ln: LiveNode, var: Variable) -> Option<LiveNodeKind> { assert!(ln.is_valid()); let writer = self.rwu_table.get_writer(self.idx(ln, var)); - if writer.is_valid() { Some(self.ir.lnk(writer)) } else { None } + if writer.is_valid() { Some(self.ir.lnks[writer]) } else { None } } fn assigned_on_exit(&self, ln: LiveNode, var: Variable) -> Option<LiveNodeKind> { @@ -746,7 +742,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { let mut wr = Vec::new(); { let wr = &mut wr as &mut dyn Write; - write!(wr, "[{:?} of kind {:?} reads", ln, self.ir.lnk(ln)); + write!(wr, "[{:?} of kind {:?} reads", ln, self.ir.lnks[ln]); self.write_vars(wr, ln, |idx| self.rwu_table.get_reader(idx).is_valid()); write!(wr, " writes"); self.write_vars(wr, ln, |idx| self.rwu_table.get_writer(idx).is_valid()); |
