|
2 | 2 | use crate::maybe_pqp_cg_ssa as rustc_codegen_ssa; |
3 | 3 |
|
4 | 4 | use crate::codegen_cx::{CodegenArgs, SpirvMetadata}; |
5 | | -use crate::{SpirvCodegenBackend, SpirvModuleBuffer, linker}; |
| 5 | +use crate::{linker}; |
6 | 6 | use ar::{Archive, GnuBuilder, Header}; |
7 | 7 | use rspirv::binary::Assemble; |
8 | 8 | use rspirv::dr::Module; |
9 | 9 | use rustc_attr_parsing::eval_config_entry; |
10 | 10 | use rustc_codegen_spirv_types::{CompileResult, ModuleResult}; |
11 | | -use rustc_codegen_ssa::back::lto::{SerializedModule, ThinModule, ThinShared}; |
12 | | -use rustc_codegen_ssa::back::write::CodegenContext; |
13 | 11 | use rustc_codegen_ssa::{CompiledModules, CrateInfo, NativeLib}; |
14 | 12 | use rustc_data_structures::fx::FxHashSet; |
15 | 13 | use rustc_errors::Diag; |
16 | 14 | use rustc_hir::attrs::NativeLibKind; |
17 | 15 | use rustc_metadata::{EncodedMetadata, fs::METADATA_FILENAME}; |
18 | 16 | use rustc_middle::bug; |
19 | | -use rustc_middle::dep_graph::WorkProduct; |
20 | 17 | use rustc_middle::middle::dependency_format::Linkage; |
21 | 18 | use rustc_session::Session; |
22 | 19 | use rustc_session::config::{ |
23 | | - CrateType, DebugInfo, Lto, OptLevel, OutFileName, OutputFilenames, OutputType, |
| 20 | + CrateType, DebugInfo, OptLevel, OutFileName, OutputFilenames, OutputType, |
24 | 21 | }; |
25 | 22 | use rustc_session::output::{check_file_is_writeable, invalid_output_for_target, out_filename}; |
26 | 23 | use rustc_span::Symbol; |
27 | 24 | use spirv_tools::TargetEnv; |
28 | 25 | use std::collections::BTreeMap; |
29 | | -use std::ffi::{CString, OsStr}; |
| 26 | +use std::ffi::OsStr; |
30 | 27 | use std::fs::File; |
31 | 28 | use std::io::{BufWriter, Read}; |
32 | 29 | use std::iter; |
33 | 30 | use std::path::{Path, PathBuf}; |
34 | 31 | use std::str::FromStr; |
35 | | -use std::sync::Arc; |
36 | 32 |
|
37 | 33 | pub fn link( |
38 | 34 | sess: &Session, |
@@ -624,52 +620,3 @@ fn do_link( |
624 | 620 | bug!("Linker errored, but no error reported"); |
625 | 621 | } |
626 | 622 | } |
627 | | - |
628 | | -/// As of right now, this is essentially a no-op, just plumbing through all the files. |
629 | | -// TODO: WorkProduct impl |
630 | | -pub(crate) fn run_thin( |
631 | | - cgcx: &CodegenContext, |
632 | | - modules: Vec<(String, SpirvModuleBuffer)>, |
633 | | - cached_modules: Vec<(SerializedModule<SpirvModuleBuffer>, WorkProduct)>, |
634 | | -) -> (Vec<ThinModule<SpirvCodegenBackend>>, Vec<WorkProduct>) { |
635 | | - if cgcx.use_linker_plugin_lto { |
636 | | - unreachable!("We should never reach this case if the LTO step is deferred to the linker"); |
637 | | - } |
638 | | - assert!( |
639 | | - cgcx.lto == Lto::ThinLocal, |
640 | | - "no actual LTO implemented in Rust-GPU" |
641 | | - ); |
642 | | - let mut thin_buffers = Vec::with_capacity(modules.len()); |
643 | | - let mut module_names = Vec::with_capacity(modules.len() + cached_modules.len()); |
644 | | - |
645 | | - for (name, buffer) in modules { |
646 | | - let cname = CString::new(name.clone()).unwrap(); |
647 | | - thin_buffers.push(buffer); |
648 | | - module_names.push(cname); |
649 | | - } |
650 | | - |
651 | | - let mut serialized_modules = Vec::with_capacity(cached_modules.len()); |
652 | | - |
653 | | - for (sm, wp) in cached_modules { |
654 | | - let _slice_u8 = sm.data(); |
655 | | - serialized_modules.push(sm); |
656 | | - module_names.push(CString::new(wp.cgu_name).unwrap()); |
657 | | - } |
658 | | - |
659 | | - let shared = Arc::new(ThinShared { |
660 | | - data: (), |
661 | | - thin_buffers, |
662 | | - serialized_modules, |
663 | | - module_names, |
664 | | - }); |
665 | | - |
666 | | - let mut opt_jobs = vec![]; |
667 | | - for (module_index, _) in shared.module_names.iter().enumerate() { |
668 | | - opt_jobs.push(ThinModule { |
669 | | - shared: shared.clone(), |
670 | | - idx: module_index, |
671 | | - }); |
672 | | - } |
673 | | - |
674 | | - (opt_jobs, vec![]) |
675 | | -} |
0 commit comments