From 5edf015ada5c7cdc85369443b063ea0162ba6591 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Fri, 24 Jan 2020 10:43:44 -0500 Subject: [PATCH] Make `get_libcall_funcref` `pub(crate)` (#1291) * Make `get_libcall_funcref` `pub(crate)` Closes https://github.com/bytecodealliance/cranelift/issues/1273. Since get_libcall_funcref is only used internally by the verifier, it doesn't make sense to have it be public. This will encourage users to look elsewhere for `memcpy` (they should be looking at https://docs.rs/cranelift-frontend/0.51.0/cranelift_frontend/struct.FunctionBuilder.html#method.emit_small_memcpy) --- cranelift/codegen/src/ir/libcall.rs | 2 +- cranelift/codegen/src/ir/mod.rs | 4 ++-- cranelift/codegen/src/legalizer/libcall.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cranelift/codegen/src/ir/libcall.rs b/cranelift/codegen/src/ir/libcall.rs index cffbfb5a90..33d3fa6060 100644 --- a/cranelift/codegen/src/ir/libcall.rs +++ b/cranelift/codegen/src/ir/libcall.rs @@ -106,7 +106,7 @@ impl LibCall { /// for `inst`. /// /// If there is an existing reference, use it, otherwise make a new one. -pub fn get_libcall_funcref( +pub(crate) fn get_libcall_funcref( libcall: LibCall, call_conv: CallConv, func: &mut Function, diff --git a/cranelift/codegen/src/ir/mod.rs b/cranelift/codegen/src/ir/mod.rs index b37812e9d3..096e372db0 100644 --- a/cranelift/codegen/src/ir/mod.rs +++ b/cranelift/codegen/src/ir/mod.rs @@ -14,7 +14,7 @@ pub mod immediates; pub mod instructions; pub mod jumptable; pub mod layout; -mod libcall; +pub(crate) mod libcall; mod memflags; mod progpoint; mod sourceloc; @@ -49,7 +49,7 @@ pub use crate::ir::instructions::{ }; pub use crate::ir::jumptable::JumpTableData; pub use crate::ir::layout::Layout; -pub use crate::ir::libcall::{get_libcall_funcref, get_probestack_funcref, LibCall}; +pub use crate::ir::libcall::{get_probestack_funcref, LibCall}; pub use crate::ir::memflags::MemFlags; pub use crate::ir::progpoint::{ExpandedProgramPoint, ProgramOrder, ProgramPoint}; pub use crate::ir::sourceloc::SourceLoc; diff --git a/cranelift/codegen/src/legalizer/libcall.rs b/cranelift/codegen/src/legalizer/libcall.rs index b34a90b519..2a4aeb4912 100644 --- a/cranelift/codegen/src/legalizer/libcall.rs +++ b/cranelift/codegen/src/legalizer/libcall.rs @@ -1,7 +1,7 @@ //! Expanding instructions as runtime library calls. use crate::ir; -use crate::ir::{get_libcall_funcref, InstBuilder}; +use crate::ir::{libcall::get_libcall_funcref, InstBuilder}; use crate::isa::{CallConv, TargetIsa}; use crate::legalizer::boundary::legalize_libcall_signature; use alloc::vec::Vec;