From c6354e9839cefbaf80d3a26304bc3e4adacfabb0 Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Wed, 20 Nov 2019 09:58:31 -0500 Subject: [PATCH] Remove inline attributes that hadn't been profiled, unexport Cache since it no longer needs to be public --- src/librustc/mir/cache.rs | 15 --------------- src/librustc/mir/mod.rs | 3 +-- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/librustc/mir/cache.rs b/src/librustc/mir/cache.rs index 44d534caa759..fcab65cdfdd9 100644 --- a/src/librustc/mir/cache.rs +++ b/src/librustc/mir/cache.rs @@ -78,13 +78,11 @@ impl Cache { } } - #[inline] pub fn invalidate_predecessors(&mut self) { // FIXME: consider being more fine-grained self.predecessors = None; } - #[inline] pub fn ensure_predecessors(&mut self, body: &Body<'_>) { if self.predecessors.is_none() { let mut result = IndexVec::from_elem(vec![], body.basic_blocks()); @@ -100,29 +98,24 @@ impl Cache { } } - #[inline] /// This will recompute the predecessors cache if it is not available fn predecessors(&mut self, body: &Body<'_>) -> &IndexVec> { self.ensure_predecessors(body); self.predecessors.as_ref().unwrap() } - #[inline] fn predecessors_for(&mut self, bb: BasicBlock, body: &Body<'_>) -> &[BasicBlock] { &self.predecessors(body)[bb] } - #[inline] fn unwrap_predecessors_for(&self, bb: BasicBlock) -> &[BasicBlock] { &self.predecessors.as_ref().unwrap()[bb] } - #[inline] impl_predecessor_locations!((pub) predecessor_locations mut); impl_predecessor_locations!(() unwrap_predecessor_locations); - #[inline] pub fn basic_blocks_mut<'a, 'tcx>( &mut self, body: &'a mut Body<'tcx> @@ -195,7 +188,6 @@ impl BodyCache<'tcx> { impl<'tcx> Index for BodyCache<'tcx> { type Output = BasicBlockData<'tcx>; - #[inline] fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx> { &self.body[index] } @@ -238,32 +230,26 @@ impl ReadOnlyBodyCache<'a, 'tcx> { } } - #[inline] pub fn predecessors(&self) -> &IndexVec> { self.cache.predecessors.as_ref().unwrap() } - #[inline] pub fn predecessors_for(&self, bb: BasicBlock) -> &[BasicBlock] { self.cache.unwrap_predecessors_for(bb) } - #[inline] pub fn predecessor_locations(&self, loc: Location) -> impl Iterator + '_ { self.cache.unwrap_predecessor_locations(loc, self.body) } - #[inline] pub fn body(&self) -> &'a Body<'tcx> { self.body } - #[inline] pub fn basic_blocks(&self) -> &IndexVec> { &self.body.basic_blocks } - #[inline] pub fn dominators(&self) -> Dominators { dominators(self) } @@ -325,7 +311,6 @@ impl Deref for ReadOnlyBodyCache<'a, 'tcx> { impl Index for ReadOnlyBodyCache<'a, 'tcx> { type Output = BasicBlockData<'tcx>; - #[inline] fn index(&self, index: BasicBlock) -> &BasicBlockData<'tcx> { &self.body[index] } diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index ea858c80db79..cc25ad0e2252 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -38,8 +38,7 @@ use syntax::symbol::Symbol; use syntax_pos::{Span, DUMMY_SP}; pub use crate::mir::interpret::AssertMessage; -// FIXME(nashenas88) Cache only exported for use in librustc_mir/transform/check_unsafety.rs -pub use crate::mir::cache::{BodyCache, Cache, ReadOnlyBodyCache}; +pub use crate::mir::cache::{BodyCache, ReadOnlyBodyCache}; pub use crate::read_only; pub mod cache;