about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Daniel Faria <Nashenas88@users.noreply.github.com>2019-11-20 09:58:31 -0500
committerPaul Daniel Faria <Nashenas88@users.noreply.github.com>2019-12-02 08:41:30 -0500
commitc6354e9839cefbaf80d3a26304bc3e4adacfabb0 (patch)
tree7043be5abeeb879ad7b35677b143276b3a67facb
parent245abc49be638e79781e6c3d633aba7a171d80d4 (diff)
downloadrust-c6354e9839cefbaf80d3a26304bc3e4adacfabb0.tar.gz
rust-c6354e9839cefbaf80d3a26304bc3e4adacfabb0.zip
Remove inline attributes that hadn't been profiled, unexport Cache since it no longer needs to be public
-rw-r--r--src/librustc/mir/cache.rs15
-rw-r--r--src/librustc/mir/mod.rs3
2 files changed, 1 insertions, 17 deletions
diff --git a/src/librustc/mir/cache.rs b/src/librustc/mir/cache.rs
index 44d534caa75..fcab65cdfdd 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<BasicBlock, Vec<BasicBlock>> {
         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<BasicBlock> 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<BasicBlock, Vec<BasicBlock>> {
         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<Item = Location> + '_ {
         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<BasicBlock, BasicBlockData<'tcx>> {
         &self.body.basic_blocks
     }
 
-    #[inline]
     pub fn dominators(&self) -> Dominators<BasicBlock> {
         dominators(self)
     }
@@ -325,7 +311,6 @@ impl Deref for ReadOnlyBodyCache<'a, 'tcx> {
 impl Index<BasicBlock> 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 ea858c80db7..cc25ad0e225 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;