Skip to content

Commit

Permalink
Make ExportedSymbols type more local because it's not supposed to be
Browse files Browse the repository at this point in the history
used outside of the LLVM backend.
  • Loading branch information
michaelwoerister committed Jan 23, 2020
1 parent 29951ed commit 0c366cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/librustc_codegen_ssa/back/symbol_export.rs
Expand Up @@ -17,8 +17,6 @@ use rustc_hir::Node;
use rustc_index::vec::IndexVec;
use syntax::expand::allocator::ALLOCATOR_METHODS;

pub type ExportedSymbols = FxHashMap<CrateNum, Arc<Vec<(String, SymbolExportLevel)>>>;

pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
crates_export_threshold(&tcx.sess.crate_types.borrow())
}
Expand Down Expand Up @@ -96,7 +94,7 @@ fn reachable_non_generics_provider(
if !generics.requires_monomorphization(tcx) &&
// Functions marked with #[inline] are only ever codegened
// with "internal" linkage and are never exported.
!Instance::mono(tcx, def_id).def.requires_local(tcx)
!Instance::mono(tcx, def_id).def.generates_cgu_internal_copy(tcx)
{
Some(def_id)
} else {
Expand Down
6 changes: 5 additions & 1 deletion src/librustc_codegen_ssa/back/write.rs
Expand Up @@ -2,7 +2,8 @@ use super::command::Command;
use super::link::{self, get_linker, remove};
use super::linker::LinkerInfo;
use super::lto::{self, SerializedModule};
use super::symbol_export::{symbol_name_for_instance_in_crate, ExportedSymbols};
use super::symbol_export::symbol_name_for_instance_in_crate;

use crate::{
CachedModuleCodegen, CodegenResults, CompiledModule, CrateInfo, ModuleCodegen, ModuleKind,
RLIB_BYTECODE_EXTENSION,
Expand All @@ -12,6 +13,7 @@ use crate::traits::*;
use jobserver::{Acquired, Client};
use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
use rustc::middle::cstore::EncodedMetadata;
use rustc::middle::exported_symbols::SymbolExportLevel;
use rustc::session::config::{
self, Lto, OutputFilenames, OutputType, Passes, Sanitizer, SwitchWithOptPath,
};
Expand Down Expand Up @@ -205,6 +207,8 @@ impl<B: WriteBackendMethods> Clone for TargetMachineFactory<B> {
}
}

pub type ExportedSymbols = FxHashMap<CrateNum, Arc<Vec<(String, SymbolExportLevel)>>>;

/// Additional resources used by optimize_and_codegen (not module specific)
#[derive(Clone)]
pub struct CodegenContext<B: WriteBackendMethods> {
Expand Down

0 comments on commit 0c366cd

Please sign in to comment.