about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-01-14 17:11:06 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-01-14 17:11:06 +0100
commit09b44f5d25911b40e6c91fe160a89009ba6ddfe1 (patch)
tree10f8bb8eb38ab5b13e6234c12522a724e470cb47 /src
parent29fafb44b1de93c4f5000064ab06bd756b8499f9 (diff)
Reduce visibility
Diffstat (limited to 'src')
-rw-r--r--src/abi/pass_mode.rs22
-rw-r--r--src/abi/returning.rs4
-rw-r--r--src/allocator.rs2
-rw-r--r--src/common.rs2
-rw-r--r--src/debuginfo/line_info.rs2
-rw-r--r--src/intrinsics/mod.rs2
-rw-r--r--src/intrinsics/simd.rs2
-rw-r--r--src/optimize/code_layout.rs2
8 files changed, 19 insertions, 19 deletions
diff --git a/src/abi/pass_mode.rs b/src/abi/pass_mode.rs
index b2df2777987..58f6eaf25ce 100644
--- a/src/abi/pass_mode.rs
+++ b/src/abi/pass_mode.rs
@@ -1,5 +1,7 @@
 use crate::prelude::*;
 
+pub(super) use EmptySinglePair::*;
+
 #[derive(Copy, Clone, Debug)]
 pub enum PassMode {
     NoPass,
@@ -9,18 +11,18 @@ pub enum PassMode {
 }
 
 #[derive(Copy, Clone, Debug)]
-pub enum EmptySinglePair<T> {
+pub(super) enum EmptySinglePair<T> {
     Empty,
     Single(T),
     Pair(T, T),
 }
 
 impl<T> EmptySinglePair<T> {
-    pub fn into_iter(self) -> EmptySinglePairIter<T> {
+    pub(super) fn into_iter(self) -> EmptySinglePairIter<T> {
         EmptySinglePairIter(self)
     }
 
-    pub fn map<U>(self, mut f: impl FnMut(T) -> U) -> EmptySinglePair<U> {
+    pub(super) fn map<U>(self, mut f: impl FnMut(T) -> U) -> EmptySinglePair<U> {
         match self {
             Empty => Empty,
             Single(v) => Single(f(v)),
@@ -29,7 +31,7 @@ impl<T> EmptySinglePair<T> {
     }
 }
 
-pub struct EmptySinglePairIter<T>(EmptySinglePair<T>);
+pub(super) struct EmptySinglePairIter<T>(EmptySinglePair<T>);
 
 impl<T> Iterator for EmptySinglePairIter<T> {
     type Item = T;
@@ -47,14 +49,14 @@ impl<T> Iterator for EmptySinglePairIter<T> {
 }
 
 impl<T: std::fmt::Debug> EmptySinglePair<T> {
-    pub fn assert_single(self) -> T {
+    pub(super) fn assert_single(self) -> T {
         match self {
             Single(v) => v,
             _ => panic!("Called assert_single on {:?}", self),
         }
     }
 
-    pub fn assert_pair(self) -> (T, T) {
+    pub(super) fn assert_pair(self) -> (T, T) {
         match self {
             Pair(a, b) => (a, b),
             _ => panic!("Called assert_pair on {:?}", self),
@@ -62,10 +64,8 @@ impl<T: std::fmt::Debug> EmptySinglePair<T> {
     }
 }
 
-pub use EmptySinglePair::*;
-
 impl PassMode {
-    pub fn get_param_ty(self, tcx: TyCtxt<'_>) -> EmptySinglePair<Type> {
+    pub(super) fn get_param_ty(self, tcx: TyCtxt<'_>) -> EmptySinglePair<Type> {
         match self {
             PassMode::NoPass => Empty,
             PassMode::ByVal(clif_type) => Single(clif_type),
@@ -108,7 +108,7 @@ pub fn get_pass_mode<'tcx>(tcx: TyCtxt<'tcx>, layout: TyLayout<'tcx>) -> PassMod
     }
 }
 
-pub fn adjust_arg_for_abi<'tcx>(
+pub(super) fn adjust_arg_for_abi<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     arg: CValue<'tcx>,
 ) -> EmptySinglePair<Value> {
@@ -123,7 +123,7 @@ pub fn adjust_arg_for_abi<'tcx>(
     }
 }
 
-pub fn cvalue_for_param<'tcx>(
+pub(super) fn cvalue_for_param<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     start_ebb: Ebb,
     local: Option<mir::Local>,
diff --git a/src/abi/returning.rs b/src/abi/returning.rs
index f0a36e193b2..5228eb6031b 100644
--- a/src/abi/returning.rs
+++ b/src/abi/returning.rs
@@ -13,7 +13,7 @@ pub fn can_return_to_ssa_var<'tcx>(tcx: TyCtxt<'tcx>, dest_layout: TyLayout<'tcx
     }
 }
 
-pub fn codegen_return_param(
+pub(super) fn codegen_return_param(
     fx: &mut FunctionCx<impl Backend>,
     ssa_analyzed: &rustc_index::vec::IndexVec<Local, crate::analyze::SsaKind>,
     start_ebb: Ebb,
@@ -54,7 +54,7 @@ pub fn codegen_return_param(
     );
 }
 
-pub fn codegen_with_call_return_arg<'tcx, B: Backend, T>(
+pub(super) fn codegen_with_call_return_arg<'tcx, B: Backend, T>(
     fx: &mut FunctionCx<'_, 'tcx, B>,
     fn_sig: FnSig<'tcx>,
     ret_place: Option<CPlace<'tcx>>,
diff --git a/src/allocator.rs b/src/allocator.rs
index cfcb091afb5..df9e6aa1962 100644
--- a/src/allocator.rs
+++ b/src/allocator.rs
@@ -28,7 +28,7 @@ pub fn codegen(tcx: TyCtxt<'_>, module: &mut Module<impl Backend + 'static>) ->
     }
 }
 
-pub fn codegen_inner(module: &mut Module<impl Backend + 'static>, kind: AllocatorKind) {
+fn codegen_inner(module: &mut Module<impl Backend + 'static>, kind: AllocatorKind) {
     let usize_ty = module.target_config().pointer_type();
 
     for method in ALLOCATOR_METHODS {
diff --git a/src/common.rs b/src/common.rs
index 201467c62a0..dcf47f6657a 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -34,7 +34,7 @@ pub fn scalar_to_clif_type(tcx: TyCtxt, scalar: Scalar) -> Type {
     }
 }
 
-pub fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<types::Type> {
+fn clif_type_from_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<types::Type> {
     Some(match ty.kind {
         ty::Bool => types::I8,
         ty::Uint(size) => match size {
diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs
index 107ab6b763d..3152e4812f7 100644
--- a/src/debuginfo/line_info.rs
+++ b/src/debuginfo/line_info.rs
@@ -101,7 +101,7 @@ impl<'tcx> DebugContext<'tcx> {
 }
 
 impl<'a, 'tcx> FunctionDebugContext<'a, 'tcx> {
-    pub(crate) fn create_debug_lines(
+    pub(super) fn create_debug_lines(
         &mut self,
         context: &Context,
         isa: &dyn cranelift_codegen::isa::TargetIsa,
diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs
index 0aab46b3bf0..70c9167c69e 100644
--- a/src/intrinsics/mod.rs
+++ b/src/intrinsics/mod.rs
@@ -127,7 +127,7 @@ macro atomic_minmax($fx:expr, $cc:expr, <$T:ident> ($ptr:ident, $src:ident) -> $
     $ret.write_cvalue($fx, ret_val);
 }
 
-pub fn lane_type_and_count<'tcx>(
+fn lane_type_and_count<'tcx>(
     tcx: TyCtxt<'tcx>,
     layout: TyLayout<'tcx>,
 ) -> (TyLayout<'tcx>, u32) {
diff --git a/src/intrinsics/simd.rs b/src/intrinsics/simd.rs
index cd163aa7ed3..04e55d80187 100644
--- a/src/intrinsics/simd.rs
+++ b/src/intrinsics/simd.rs
@@ -1,7 +1,7 @@
 use crate::prelude::*;
 use super::*;
 
-pub fn codegen_simd_intrinsic_call<'tcx>(
+pub(super) fn codegen_simd_intrinsic_call<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     instance: Instance<'tcx>,
     args: &[mir::Operand<'tcx>],
diff --git a/src/optimize/code_layout.rs b/src/optimize/code_layout.rs
index 947b61d42e0..4d2301c6f6c 100644
--- a/src/optimize/code_layout.rs
+++ b/src/optimize/code_layout.rs
@@ -10,7 +10,7 @@
 
 use crate::prelude::*;
 
-pub fn optimize_function(ctx: &mut Context, cold_ebbs: &EntitySet<Ebb>) {
+pub(super) fn optimize_function(ctx: &mut Context, cold_ebbs: &EntitySet<Ebb>) {
     // FIXME Move the ebb in place instead of remove and append once
     // bytecodealliance/cranelift#1339 is implemented.