Reduce API surface of rustc_trans

Mark various items and fields as private or pub(crate), and remove a function that turns out to be unused.
These are not used anywhere in-tree, but I guess it's a [breaking-change] for plugins.
This commit is contained in:
Robin Kruppe 2017-05-27 20:13:32 +02:00
parent 557967766b
commit 493cd6b6e2
3 changed files with 13 additions and 26 deletions

View file

@ -40,8 +40,8 @@ const CFG: &'static str = "cfg";
#[derive(Debug, PartialEq)]
enum Disposition { Reused, Translated }
pub fn assert_module_sources<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
modules: &[ModuleTranslation]) {
pub(crate) fn assert_module_sources<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
modules: &[ModuleTranslation]) {
let _ignore = tcx.dep_graph.in_ignore();
if tcx.sess.opts.incremental.is_none() {

View file

@ -348,16 +348,6 @@ impl ItemPathBuffer for SymbolPathBuffer {
}
}
pub fn exported_name_from_type_and_prefix<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
t: Ty<'tcx>,
prefix: &str)
-> String {
let hash = get_symbol_hash(tcx, None, t, None);
let mut buffer = SymbolPathBuffer::new();
buffer.push(prefix);
buffer.finish(hash)
}
// Name sanitation. LLVM will happily accept identifiers with weird names, but
// gas doesn't!
// gas accepts the following characters in symbols: a-z, A-Z, 0-9, ., _, $

View file

@ -63,10 +63,9 @@ extern crate syntax_pos;
extern crate rustc_errors as errors;
extern crate serialize;
pub use rustc::session;
pub use rustc::middle;
pub use rustc::lint;
pub use rustc::util;
use rustc::session;
use rustc::middle;
use rustc::util;
pub use base::trans_crate;
pub use back::symbol_names::provide;
@ -75,20 +74,18 @@ pub use metadata::LlvmMetadataLoader;
pub use llvm_util::{init, target_features, print_version, print_passes, print, enable_llvm_debug};
pub mod back {
pub use rustc::hir::svh;
pub mod archive;
pub mod linker;
mod archive;
pub(crate) mod linker;
pub mod link;
pub mod lto;
pub mod symbol_export;
pub mod symbol_names;
mod lto;
pub(crate) mod symbol_export;
pub(crate) mod symbol_names;
pub mod write;
pub mod msvc;
pub mod rpath;
mod msvc;
mod rpath;
}
pub mod diagnostics;
mod diagnostics;
mod abi;
mod adt;