Skip to content

Commit

Permalink
Remove the (inaccurate) symbol_export_level query.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwoerister committed Apr 6, 2018
1 parent 8d95c86 commit e203b3a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/librustc/dep_graph/dep_node.rs
Expand Up @@ -648,8 +648,6 @@ define_dep_nodes!( <'tcx>

[] InstanceDefSizeEstimate { instance_def: InstanceDef<'tcx> },

[] GetSymbolExportLevel(DefId),

[] WasmCustomSections(CrateNum),

[input] Features,
Expand Down
1 change: 0 additions & 1 deletion src/librustc/ty/maps/mod.rs
Expand Up @@ -390,7 +390,6 @@ define_maps! { <'tcx>
[] fn collect_and_partition_translation_items:
collect_and_partition_translation_items_node(CrateNum)
-> (Arc<DefIdSet>, Arc<Vec<Arc<CodegenUnit<'tcx>>>>),
[] fn symbol_export_level: GetSymbolExportLevel(DefId) -> SymbolExportLevel,
[] fn is_translated_item: IsTranslatedItem(DefId) -> bool,
[] fn codegen_unit: CodegenUnit(InternedString) -> Arc<CodegenUnit<'tcx>>,
[] fn compile_codegen_unit: CompileCodegenUnit(InternedString) -> Stats,
Expand Down
1 change: 0 additions & 1 deletion src/librustc/ty/maps/plumbing.rs
Expand Up @@ -1087,7 +1087,6 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,

DepKind::TargetFeaturesWhitelist => { force!(target_features_whitelist, LOCAL_CRATE); }

DepKind::GetSymbolExportLevel => { force!(symbol_export_level, def_id!()); }
DepKind::Features => { force!(features_query, LOCAL_CRATE); }

DepKind::ProgramClausesFor => { force!(program_clauses_for, def_id!()); }
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_mir/monomorphize/partitioning.rs
Expand Up @@ -328,7 +328,8 @@ fn place_root_translation_items<'a, 'tcx, I>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let mut can_be_internalized = true;
let default_visibility = |id: DefId| {
if tcx.sess.target.target.options.default_hidden_visibility &&
tcx.symbol_export_level(id) != SymbolExportLevel::C
tcx.reachable_non_generics(id.krate).get(&id).cloned() !=
Some(SymbolExportLevel::C)
{
Visibility::Hidden
} else {
Expand Down
6 changes: 2 additions & 4 deletions src/librustc_trans/back/symbol_export.rs
Expand Up @@ -146,7 +146,7 @@ fn reachable_non_generics_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
SymbolExportLevel::Rust
}
} else {
tcx.symbol_export_level(def_id)
symbol_export_level(tcx, def_id)
};
debug!("EXPORTED SYMBOL (local): {} ({:?})",
tcx.symbol_name(Instance::mono(tcx, def_id)),
Expand Down Expand Up @@ -314,17 +314,15 @@ pub fn provide(providers: &mut Providers) {
providers.reachable_non_generics = reachable_non_generics_provider;
providers.is_reachable_non_generic = is_reachable_non_generic_provider_local;
providers.exported_symbols = exported_symbols_provider_local;
providers.symbol_export_level = symbol_export_level_provider;
providers.upstream_monomorphizations = upstream_monomorphizations_provider;
}

pub fn provide_extern(providers: &mut Providers) {
providers.is_reachable_non_generic = is_reachable_non_generic_provider_extern;
providers.symbol_export_level = symbol_export_level_provider;
providers.upstream_monomorphizations_for = upstream_monomorphizations_for_provider;
}

fn symbol_export_level_provider(tcx: TyCtxt, sym_def_id: DefId) -> SymbolExportLevel {
fn symbol_export_level(tcx: TyCtxt, sym_def_id: DefId) -> SymbolExportLevel {
// We export anything that's not mangled at the "C" layer as it probably has
// to do with ABI concerns. We do not, however, apply such treatment to
// special symbols in the standard library for various plumbing between
Expand Down

0 comments on commit e203b3a

Please sign in to comment.