Remove unused fields from CodegenContext
.
This commit is contained in:
parent
3bbf9f0128
commit
fae4f45214
2 changed files with 3 additions and 21 deletions
|
@ -320,7 +320,6 @@ pub type ExportedSymbols = FxHashMap<CrateNum, Arc<Vec<(String, SymbolExportInfo
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct CodegenContext<B: WriteBackendMethods> {
|
pub struct CodegenContext<B: WriteBackendMethods> {
|
||||||
// Resources needed when running LTO
|
// Resources needed when running LTO
|
||||||
pub backend: B,
|
|
||||||
pub prof: SelfProfilerRef,
|
pub prof: SelfProfilerRef,
|
||||||
pub lto: Lto,
|
pub lto: Lto,
|
||||||
pub save_temps: bool,
|
pub save_temps: bool,
|
||||||
|
@ -338,14 +337,10 @@ pub struct CodegenContext<B: WriteBackendMethods> {
|
||||||
pub msvc_imps_needed: bool,
|
pub msvc_imps_needed: bool,
|
||||||
pub is_pe_coff: bool,
|
pub is_pe_coff: bool,
|
||||||
pub target_can_use_split_dwarf: bool,
|
pub target_can_use_split_dwarf: bool,
|
||||||
pub target_pointer_width: u32,
|
|
||||||
pub target_arch: String,
|
pub target_arch: String,
|
||||||
pub debuginfo: config::DebugInfo,
|
|
||||||
pub split_debuginfo: rustc_target::spec::SplitDebuginfo,
|
pub split_debuginfo: rustc_target::spec::SplitDebuginfo,
|
||||||
pub split_dwarf_kind: rustc_session::config::SplitDwarfKind,
|
pub split_dwarf_kind: rustc_session::config::SplitDwarfKind,
|
||||||
|
|
||||||
/// Number of cgus excluding the allocator/metadata modules
|
|
||||||
pub total_cgus: usize,
|
|
||||||
/// Handler to use for diagnostics produced during codegen.
|
/// Handler to use for diagnostics produced during codegen.
|
||||||
pub diag_emitter: SharedEmitter,
|
pub diag_emitter: SharedEmitter,
|
||||||
/// LLVM optimizations for which we want to print remarks.
|
/// LLVM optimizations for which we want to print remarks.
|
||||||
|
@ -441,7 +436,6 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
|
||||||
target_cpu: String,
|
target_cpu: String,
|
||||||
metadata: EncodedMetadata,
|
metadata: EncodedMetadata,
|
||||||
metadata_module: Option<CompiledModule>,
|
metadata_module: Option<CompiledModule>,
|
||||||
total_cgus: usize,
|
|
||||||
) -> OngoingCodegen<B> {
|
) -> OngoingCodegen<B> {
|
||||||
let (coordinator_send, coordinator_receive) = channel();
|
let (coordinator_send, coordinator_receive) = channel();
|
||||||
let sess = tcx.sess;
|
let sess = tcx.sess;
|
||||||
|
@ -469,7 +463,6 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
|
||||||
shared_emitter,
|
shared_emitter,
|
||||||
codegen_worker_send,
|
codegen_worker_send,
|
||||||
coordinator_receive,
|
coordinator_receive,
|
||||||
total_cgus,
|
|
||||||
sess.jobserver.clone(),
|
sess.jobserver.clone(),
|
||||||
Arc::new(regular_config),
|
Arc::new(regular_config),
|
||||||
Arc::new(metadata_config),
|
Arc::new(metadata_config),
|
||||||
|
@ -982,7 +975,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
|
||||||
shared_emitter: SharedEmitter,
|
shared_emitter: SharedEmitter,
|
||||||
codegen_worker_send: Sender<CguMessage>,
|
codegen_worker_send: Sender<CguMessage>,
|
||||||
coordinator_receive: Receiver<Box<dyn Any + Send>>,
|
coordinator_receive: Receiver<Box<dyn Any + Send>>,
|
||||||
total_cgus: usize,
|
|
||||||
jobserver: Client,
|
jobserver: Client,
|
||||||
regular_config: Arc<ModuleConfig>,
|
regular_config: Arc<ModuleConfig>,
|
||||||
metadata_config: Arc<ModuleConfig>,
|
metadata_config: Arc<ModuleConfig>,
|
||||||
|
@ -1050,7 +1042,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
|
||||||
};
|
};
|
||||||
let backend_features = tcx.global_backend_features(());
|
let backend_features = tcx.global_backend_features(());
|
||||||
let cgcx = CodegenContext::<B> {
|
let cgcx = CodegenContext::<B> {
|
||||||
backend: backend.clone(),
|
|
||||||
crate_types: sess.crate_types().to_vec(),
|
crate_types: sess.crate_types().to_vec(),
|
||||||
each_linked_rlib_for_lto,
|
each_linked_rlib_for_lto,
|
||||||
lto: sess.lto(),
|
lto: sess.lto(),
|
||||||
|
@ -1071,13 +1062,10 @@ fn start_executing_work<B: ExtraBackendMethods>(
|
||||||
metadata_module_config: metadata_config,
|
metadata_module_config: metadata_config,
|
||||||
allocator_module_config: allocator_config,
|
allocator_module_config: allocator_config,
|
||||||
tm_factory: backend.target_machine_factory(tcx.sess, ol, backend_features),
|
tm_factory: backend.target_machine_factory(tcx.sess, ol, backend_features),
|
||||||
total_cgus,
|
|
||||||
msvc_imps_needed: msvc_imps_needed(tcx),
|
msvc_imps_needed: msvc_imps_needed(tcx),
|
||||||
is_pe_coff: tcx.sess.target.is_like_windows,
|
is_pe_coff: tcx.sess.target.is_like_windows,
|
||||||
target_can_use_split_dwarf: tcx.sess.target_can_use_split_dwarf(),
|
target_can_use_split_dwarf: tcx.sess.target_can_use_split_dwarf(),
|
||||||
target_pointer_width: tcx.sess.target.pointer_width,
|
|
||||||
target_arch: tcx.sess.target.arch.to_string(),
|
target_arch: tcx.sess.target.arch.to_string(),
|
||||||
debuginfo: tcx.sess.opts.debuginfo,
|
|
||||||
split_debuginfo: tcx.sess.split_debuginfo(),
|
split_debuginfo: tcx.sess.split_debuginfo(),
|
||||||
split_dwarf_kind: tcx.sess.opts.unstable_opts.split_dwarf_kind,
|
split_dwarf_kind: tcx.sess.opts.unstable_opts.split_dwarf_kind,
|
||||||
};
|
};
|
||||||
|
|
|
@ -580,7 +580,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
|
||||||
) -> OngoingCodegen<B> {
|
) -> OngoingCodegen<B> {
|
||||||
// Skip crate items and just output metadata in -Z no-codegen mode.
|
// Skip crate items and just output metadata in -Z no-codegen mode.
|
||||||
if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() {
|
if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() {
|
||||||
let ongoing_codegen = start_async_codegen(backend, tcx, target_cpu, metadata, None, 1);
|
let ongoing_codegen = start_async_codegen(backend, tcx, target_cpu, metadata, None);
|
||||||
|
|
||||||
ongoing_codegen.codegen_finished(tcx);
|
ongoing_codegen.codegen_finished(tcx);
|
||||||
|
|
||||||
|
@ -631,14 +631,8 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
let ongoing_codegen = start_async_codegen(
|
let ongoing_codegen =
|
||||||
backend.clone(),
|
start_async_codegen(backend.clone(), tcx, target_cpu, metadata, metadata_module);
|
||||||
tcx,
|
|
||||||
target_cpu,
|
|
||||||
metadata,
|
|
||||||
metadata_module,
|
|
||||||
codegen_units.len(),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Codegen an allocator shim, if necessary.
|
// Codegen an allocator shim, if necessary.
|
||||||
if let Some(kind) = allocator_kind_for_codegen(tcx) {
|
if let Some(kind) = allocator_kind_for_codegen(tcx) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue