diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-08-31 18:36:25 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2021-09-08 18:25:47 +0200 |
| commit | 58000ed0e9152e331dc7c7319c7783cc7f028f84 (patch) | |
| tree | 016c84e135bedde47645080539c80260a28f6011 /compiler/rustc_codegen_ssa/src/back | |
| parent | a4a22f07d79b1a2adc6e59811ebfbcd8b2cf21a4 (diff) | |
| download | rust-58000ed0e9152e331dc7c7319c7783cc7f028f84.tar.gz rust-58000ed0e9152e331dc7c7319c7783cc7f028f84.zip | |
Move get_tools_search_paths from FileSearch to Session
It only uses fields of FileSearch that are stored in Session too
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/linker.rs | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 4fb51ecc1d3..826c09cd948 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -637,7 +637,7 @@ fn link_dwarf_object<'a>(sess: &'a Session, executable_out_filename: &Path) { cmd.arg("-o"); cmd.arg(&dwp_out_filename); - let mut new_path = sess.host_filesearch(PathKind::All).get_tools_search_paths(false); + let mut new_path = sess.get_tools_search_paths(false); if let Some(path) = env::var_os("PATH") { new_path.extend(env::split_paths(&path)); } @@ -2555,8 +2555,7 @@ fn add_gcc_ld_path(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { match ld_impl { LdImpl::Lld => { if sess.target.lld_flavor == LldFlavor::Ld64 { - let tools_path = - sess.host_filesearch(PathKind::All).get_tools_search_paths(false); + let tools_path = sess.get_tools_search_paths(false); let ld64_exe = tools_path .into_iter() .map(|p| p.join("gcc-ld")) @@ -2571,8 +2570,7 @@ fn add_gcc_ld_path(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) { arg }); } else { - let tools_path = - sess.host_filesearch(PathKind::All).get_tools_search_paths(false); + let tools_path = sess.get_tools_search_paths(false); let lld_path = tools_path .into_iter() .map(|p| p.join("gcc-ld")) diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index 9e1c6a169f1..e3b0eea0d89 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -15,7 +15,6 @@ use rustc_middle::middle::dependency_format::Linkage; use rustc_middle::ty::TyCtxt; use rustc_serialize::{json, Encoder}; use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip}; -use rustc_session::search_paths::PathKind; use rustc_session::Session; use rustc_span::symbol::Symbol; use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor}; @@ -101,7 +100,7 @@ pub fn get_linker<'a>( // The compiler's sysroot often has some bundled tools, so add it to the // PATH for the child. - let mut new_path = sess.host_filesearch(PathKind::All).get_tools_search_paths(self_contained); + let mut new_path = sess.get_tools_search_paths(self_contained); let mut msvc_changed_path = false; if sess.target.is_like_msvc { if let Some(ref tool) = msvc_tool { |
