Skip to content

Commit b5660a8

Browse files
committed
Update wasm_import_module_map and target_features_whitelist
1 parent 88a2342 commit b5660a8

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

src/librustc/arena.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ macro_rules! arena_types {
8383
[few] features: syntax::feature_gate::Features,
8484
[few] all_traits: Vec<rustc::hir::def_id::DefId>,
8585
[few] privacy_access_levels: rustc::middle::privacy::AccessLevels,
86+
[few] target_features_whitelist: rustc_data_structures::fx::FxHashMap<
87+
String,
88+
Option<syntax::symbol::Symbol>
89+
>,
90+
[few] wasm_import_module_map: rustc_data_structures::fx::FxHashMap<
91+
rustc::hir::def_id::DefId,
92+
String
93+
>,
8694
], $tcx);
8795
)
8896
}

src/librustc/query/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ rustc_queries! {
155155
}
156156

157157
Linking {
158-
query wasm_import_module_map(_: CrateNum) -> Lrc<FxHashMap<DefId, String>> {
158+
query wasm_import_module_map(_: CrateNum) -> &'tcx FxHashMap<DefId, String> {
159159
desc { "wasm import module map" }
160160
}
161161
}
@@ -1052,7 +1052,7 @@ rustc_queries! {
10521052
}
10531053

10541054
Other {
1055-
query target_features_whitelist(_: CrateNum) -> Lrc<FxHashMap<String, Option<Symbol>>> {
1055+
query target_features_whitelist(_: CrateNum) -> &'tcx FxHashMap<String, Option<Symbol>> {
10561056
eval_always
10571057
desc { "looking up the whitelist of target features" }
10581058
}

src/librustc_codegen_llvm/attributes.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use rustc::ty::{self, TyCtxt, PolyFnSig};
1010
use rustc::ty::layout::HasTyCtxt;
1111
use rustc::ty::query::Providers;
1212
use rustc_data_structures::small_c_str::SmallCStr;
13-
use rustc_data_structures::sync::Lrc;
1413
use rustc_data_structures::fx::FxHashMap;
1514
use rustc_target::spec::PanicStrategy;
1615
use rustc_codegen_ssa::traits::*;
@@ -320,11 +319,11 @@ pub fn provide(providers: &mut Providers<'_>) {
320319
if tcx.sess.opts.actually_rustdoc {
321320
// rustdoc needs to be able to document functions that use all the features, so
322321
// whitelist them all
323-
Lrc::new(llvm_util::all_known_features()
322+
tcx.arena.alloc(llvm_util::all_known_features()
324323
.map(|(a, b)| (a.to_string(), b))
325324
.collect())
326325
} else {
327-
Lrc::new(llvm_util::target_feature_whitelist(tcx.sess)
326+
tcx.arena.alloc(llvm_util::target_feature_whitelist(tcx.sess)
328327
.iter()
329328
.map(|&(a, b)| (a.to_string(), b))
330329
.collect())
@@ -364,7 +363,7 @@ pub fn provide_extern(providers: &mut Providers<'_>) {
364363
}));
365364
}
366365

367-
Lrc::new(ret)
366+
tcx.arena.alloc(ret)
368367
};
369368
}
370369

src/test/run-make-fulldeps/hotplug_codegen_backend/the_backend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ impl CodegenBackend for TheBackend {
4747
fn provide(&self, providers: &mut Providers) {
4848
rustc_codegen_utils::symbol_names::provide(providers);
4949

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

0 commit comments

Comments
 (0)