diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-05-11 14:39:04 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-05-12 13:58:46 +0200 |
| commit | 0bde3b1f80f642831d8de5cd76e90fc468dd3ab5 (patch) | |
| tree | ee80ce19f9aabd2ae6d66c91a5b31176bc58ee43 /compiler/rustc_codegen_ssa | |
| parent | 4e8d4bdf4b5f185a6096c29147dff7d2d3daa7d7 (diff) | |
| download | rust-0bde3b1f80f642831d8de5cd76e90fc468dd3ab5.tar.gz rust-0bde3b1f80f642831d8de5cd76e90fc468dd3ab5.zip | |
Use () for codegen queries.
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/symbol_export.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/write.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs index b1aa9c665f2..14d6f0ba147 100644 --- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs @@ -230,7 +230,7 @@ fn exported_symbols_provider_local( // external linkage is enough for monomorphization to be linked to. let need_visibility = tcx.sess.target.dynamic_linking && !tcx.sess.target.only_cdylib; - let (_, cgus) = tcx.collect_and_partition_mono_items(LOCAL_CRATE); + let (_, cgus) = tcx.collect_and_partition_mono_items(()); for (mono_item, &(linkage, visibility)) in cgus.iter().flat_map(|cgu| cgu.items().iter()) { if linkage != Linkage::External { @@ -275,10 +275,8 @@ fn exported_symbols_provider_local( fn upstream_monomorphizations_provider( tcx: TyCtxt<'_>, - cnum: CrateNum, + (): (), ) -> DefIdMap<FxHashMap<SubstsRef<'_>, CrateNum>> { - debug_assert!(cnum == LOCAL_CRATE); - let cnums = tcx.all_crate_nums(()); let mut instances: DefIdMap<FxHashMap<_, _>> = Default::default(); @@ -341,7 +339,7 @@ fn upstream_monomorphizations_for_provider( def_id: DefId, ) -> Option<&FxHashMap<SubstsRef<'_>, CrateNum>> { debug_assert!(!def_id.is_local()); - tcx.upstream_monomorphizations(LOCAL_CRATE).get(&def_id) + tcx.upstream_monomorphizations(()).get(&def_id) } fn upstream_drop_glue_for_provider<'tcx>( diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index fb0662a3993..49774dc6d5c 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -482,7 +482,7 @@ pub fn start_async_codegen<B: ExtraBackendMethods>( codegen_worker_receive, shared_emitter_main, future: coordinator_thread, - output_filenames: tcx.output_filenames(LOCAL_CRATE), + output_filenames: tcx.output_filenames(()), } } @@ -1042,7 +1042,7 @@ fn start_executing_work<B: ExtraBackendMethods>( // If we know that we won’t be doing codegen, create target machines without optimisation. config::OptLevel::No } else { - tcx.backend_optimization_level(LOCAL_CRATE) + tcx.backend_optimization_level(()) }; let cgcx = CodegenContext::<B> { backend: backend.clone(), @@ -1061,7 +1061,7 @@ fn start_executing_work<B: ExtraBackendMethods>( cgu_reuse_tracker: sess.cgu_reuse_tracker.clone(), coordinator_send, diag_emitter: shared_emitter.clone(), - output_filenames: tcx.output_filenames(LOCAL_CRATE), + output_filenames: tcx.output_filenames(()), regular_module_config: regular_config, metadata_module_config: metadata_config, allocator_module_config: allocator_config, diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 3a3381e3778..e6126a06baa 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -485,7 +485,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>( // Run the monomorphization collector and partition the collected items into // codegen units. - let codegen_units = tcx.collect_and_partition_mono_items(LOCAL_CRATE).1; + let codegen_units = tcx.collect_and_partition_mono_items(()).1; // Force all codegen_unit queries so they are already either red or green // when compile_codegen_unit accesses them. We are not able to re-execute |
