diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-10-24 12:22:23 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-10-24 12:22:23 +0000 |
| commit | 484bc7fc8885cc580c50be4c74b800ff82451613 (patch) | |
| tree | 9b93e95dc00b6d9fb21ee61a94976c4c0bfe8b50 /compiler/rustc_codegen_cranelift/src/driver | |
| parent | 271dcc1d40b57ad129d88fef1aa7f239308fbfb4 (diff) | |
| parent | 93a5433f17ab5ed48cc88f1e69b0713b16183373 (diff) | |
| download | rust-484bc7fc8885cc580c50be4c74b800ff82451613.tar.gz rust-484bc7fc8885cc580c50be4c74b800ff82451613.zip | |
Merge commit '93a5433f17ab5ed48cc88f1e69b0713b16183373' into sync_cg_clif-2023-10-24
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/driver')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/driver/aot.rs | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/driver/aot.rs b/compiler/rustc_codegen_cranelift/src/driver/aot.rs index d3a7decc543..11229dd421e 100644 --- a/compiler/rustc_codegen_cranelift/src/driver/aot.rs +++ b/compiler/rustc_codegen_cranelift/src/driver/aot.rs @@ -361,12 +361,26 @@ pub(crate) fn run_aot( metadata: EncodedMetadata, need_metadata_module: bool, ) -> Box<OngoingCodegen> { + // FIXME handle `-Ctarget-cpu=native` + let target_cpu = match tcx.sess.opts.cg.target_cpu { + Some(ref name) => name, + None => tcx.sess.target.cpu.as_ref(), + } + .to_owned(); + let cgus = if tcx.sess.opts.output_types.should_codegen() { tcx.collect_and_partition_mono_items(()).1 } else { // If only `--emit metadata` is used, we shouldn't perform any codegen. // Also `tcx.collect_and_partition_mono_items` may panic in that case. - &[] + return Box::new(OngoingCodegen { + modules: vec![], + allocator_module: None, + metadata_module: None, + metadata, + crate_info: CrateInfo::new(tcx, target_cpu), + concurrency_limiter: ConcurrencyLimiter::new(tcx.sess, 0), + }); }; if tcx.dep_graph.is_fully_enabled() { @@ -481,13 +495,6 @@ pub(crate) fn run_aot( None }; - // FIXME handle `-Ctarget-cpu=native` - let target_cpu = match tcx.sess.opts.cg.target_cpu { - Some(ref name) => name, - None => tcx.sess.target.cpu.as_ref(), - } - .to_owned(); - Box::new(OngoingCodegen { modules, allocator_module, |
