Skip to content

Commit 0c366cd

Browse files
Make ExportedSymbols type more local because it's not supposed to be
used outside of the LLVM backend.
1 parent 29951ed commit 0c366cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/librustc_codegen_ssa/back/symbol_export.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ use rustc_hir::Node;
1717
use rustc_index::vec::IndexVec;
1818
use syntax::expand::allocator::ALLOCATOR_METHODS;
1919

20-
pub type ExportedSymbols = FxHashMap<CrateNum, Arc<Vec<(String, SymbolExportLevel)>>>;
21-
2220
pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel {
2321
crates_export_threshold(&tcx.sess.crate_types.borrow())
2422
}
@@ -96,7 +94,7 @@ fn reachable_non_generics_provider(
9694
if !generics.requires_monomorphization(tcx) &&
9795
// Functions marked with #[inline] are only ever codegened
9896
// with "internal" linkage and are never exported.
99-
!Instance::mono(tcx, def_id).def.requires_local(tcx)
97+
!Instance::mono(tcx, def_id).def.generates_cgu_internal_copy(tcx)
10098
{
10199
Some(def_id)
102100
} else {

src/librustc_codegen_ssa/back/write.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use super::command::Command;
22
use super::link::{self, get_linker, remove};
33
use super::linker::LinkerInfo;
44
use super::lto::{self, SerializedModule};
5-
use super::symbol_export::{symbol_name_for_instance_in_crate, ExportedSymbols};
5+
use super::symbol_export::symbol_name_for_instance_in_crate;
6+
67
use crate::{
78
CachedModuleCodegen, CodegenResults, CompiledModule, CrateInfo, ModuleCodegen, ModuleKind,
89
RLIB_BYTECODE_EXTENSION,
@@ -12,6 +13,7 @@ use crate::traits::*;
1213
use jobserver::{Acquired, Client};
1314
use rustc::dep_graph::{WorkProduct, WorkProductFileKind, WorkProductId};
1415
use rustc::middle::cstore::EncodedMetadata;
16+
use rustc::middle::exported_symbols::SymbolExportLevel;
1517
use rustc::session::config::{
1618
self, Lto, OutputFilenames, OutputType, Passes, Sanitizer, SwitchWithOptPath,
1719
};
@@ -205,6 +207,8 @@ impl<B: WriteBackendMethods> Clone for TargetMachineFactory<B> {
205207
}
206208
}
207209

210+
pub type ExportedSymbols = FxHashMap<CrateNum, Arc<Vec<(String, SymbolExportLevel)>>>;
211+
208212
/// Additional resources used by optimize_and_codegen (not module specific)
209213
#[derive(Clone)]
210214
pub struct CodegenContext<B: WriteBackendMethods> {

0 commit comments

Comments
 (0)