Skip to content
Permalink
Browse files

Update wasm_import_module_map and target_features_whitelist

  • Loading branch information...
Zoxc committed Dec 1, 2018
1 parent 9b648f7 commit 46f251129695f9e768bb444dd20a6cce8f2bfbc9
@@ -83,6 +83,14 @@ macro_rules! arena_types {
[few] features: syntax::feature_gate::Features,
[few] all_traits: Vec<rustc::hir::def_id::DefId>,
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
String,
Option<syntax::symbol::Symbol>
>,
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
rustc::hir::def_id::DefId,
String
>,
], $tcx);
)
}
@@ -155,7 +155,7 @@ rustc_queries! {
}

Linking {
query wasm_import_module_map(_: CrateNum) -> Lrc<FxHashMap<DefId, String>> {
query wasm_import_module_map(_: CrateNum) -> &'tcx FxHashMap<DefId, String> {
desc { "wasm import module map" }
}
}
@@ -1050,7 +1050,7 @@ rustc_queries! {
}

Other {
query target_features_whitelist(_: CrateNum) -> Lrc<FxHashMap<String, Option<Symbol>>> {
query target_features_whitelist(_: CrateNum) -> &'tcx FxHashMap<String, Option<Symbol>> {
eval_always
desc { "looking up the whitelist of target features" }
}
@@ -10,7 +10,6 @@ use rustc::ty::{self, TyCtxt, PolyFnSig};
use rustc::ty::layout::HasTyCtxt;
use rustc::ty::query::Providers;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::fx::FxHashMap;
use rustc_target::spec::PanicStrategy;
use rustc_codegen_ssa::traits::*;
@@ -320,11 +319,11 @@ pub fn provide(providers: &mut Providers<'_>) {
if tcx.sess.opts.actually_rustdoc {
// rustdoc needs to be able to document functions that use all the features, so
// whitelist them all
Lrc::new(llvm_util::all_known_features()
tcx.arena.alloc(llvm_util::all_known_features()
.map(|(a, b)| (a.to_string(), b))
.collect())
} else {
Lrc::new(llvm_util::target_feature_whitelist(tcx.sess)
tcx.arena.alloc(llvm_util::target_feature_whitelist(tcx.sess)
.iter()
.map(|&(a, b)| (a.to_string(), b))
.collect())
@@ -364,7 +363,7 @@ pub fn provide_extern(providers: &mut Providers<'_>) {
}));
}

Lrc::new(ret)
tcx.arena.alloc(ret)
};
}

@@ -47,8 +47,8 @@ impl CodegenBackend for TheBackend {
fn provide(&self, providers: &mut Providers) {
rustc_codegen_utils::symbol_names::provide(providers);

providers.target_features_whitelist = |_tcx, _cnum| {
Default::default() // Just a dummy
providers.target_features_whitelist = |tcx, _cnum| {
tcx.arena.alloc(Default::default()) // Just a dummy
};
providers.is_reachable_non_generic = |_tcx, _defid| true;
providers.exported_symbols = |_tcx, _crate| Arc::new(Vec::new());

0 comments on commit 46f2511

Please sign in to comment.
You can’t perform that action at this time.