about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-08 03:30:57 +0200
committerGitHub <noreply@github.com>2023-08-08 03:30:57 +0200
commit07b2c971a1f9a2db803bb93e6751f8a451fc664d (patch)
treed3afa2d901c697b08d0039dee07833fd15f48e47 /src
parent418b91a3d7abade84a652b55634c88cc7d06b7da (diff)
parent65e468f9c259749c210b1ae8972bfe14781f72f1 (diff)
downloadrust-07b2c971a1f9a2db803bb93e6751f8a451fc664d.tar.gz
rust-07b2c971a1f9a2db803bb93e6751f8a451fc664d.zip
Rollup merge of #114596 - Kobzol:opt-dist-host, r=lqd
Rename method in `opt-dist`

This makes it clearer that the LLVM is the host one (it doesn't necessarily have to be downloaded). On Linux, it comes from the Dockerfile, on Windows it's downloaded.

Suggested here: https://github.com/rust-lang/rust/pull/114344#discussion_r1285596217

r? `@lqd`
Diffstat (limited to 'src')
-rw-r--r--src/tools/opt-dist/src/environment/linux.rs2
-rw-r--r--src/tools/opt-dist/src/environment/mod.rs4
-rw-r--r--src/tools/opt-dist/src/environment/windows.rs2
-rw-r--r--src/tools/opt-dist/src/training.rs2
4 files changed, 5 insertions, 5 deletions
diff --git a/src/tools/opt-dist/src/environment/linux.rs b/src/tools/opt-dist/src/environment/linux.rs
index c2a328b1dbc..58b7e6d2306 100644
--- a/src/tools/opt-dist/src/environment/linux.rs
+++ b/src/tools/opt-dist/src/environment/linux.rs
@@ -14,7 +14,7 @@ impl Environment for LinuxEnvironment {
         Utf8PathBuf::from("/checkout")
     }
 
-    fn downloaded_llvm_dir(&self) -> Utf8PathBuf {
+    fn host_llvm_dir(&self) -> Utf8PathBuf {
         Utf8PathBuf::from("/rustroot")
     }
 
diff --git a/src/tools/opt-dist/src/environment/mod.rs b/src/tools/opt-dist/src/environment/mod.rs
index d28983d289c..a8650fad011 100644
--- a/src/tools/opt-dist/src/environment/mod.rs
+++ b/src/tools/opt-dist/src/environment/mod.rs
@@ -15,8 +15,8 @@ pub trait Environment {
     /// The rustc checkout, where the compiler source is located.
     fn checkout_path(&self) -> Utf8PathBuf;
 
-    /// Path to the downloaded host LLVM.
-    fn downloaded_llvm_dir(&self) -> Utf8PathBuf;
+    /// Path to the host LLVM used to compile LLVM in `src/llvm-project`.
+    fn host_llvm_dir(&self) -> Utf8PathBuf;
 
     /// Directory where the optimization artifacts (PGO/BOLT profiles, etc.)
     /// will be stored.
diff --git a/src/tools/opt-dist/src/environment/windows.rs b/src/tools/opt-dist/src/environment/windows.rs
index 12a63cbb03c..8a9733d6496 100644
--- a/src/tools/opt-dist/src/environment/windows.rs
+++ b/src/tools/opt-dist/src/environment/windows.rs
@@ -24,7 +24,7 @@ impl Environment for WindowsEnvironment {
         self.checkout_dir.clone()
     }
 
-    fn downloaded_llvm_dir(&self) -> Utf8PathBuf {
+    fn host_llvm_dir(&self) -> Utf8PathBuf {
         self.checkout_path().join("citools").join("clang-rust")
     }
 
diff --git a/src/tools/opt-dist/src/training.rs b/src/tools/opt-dist/src/training.rs
index e374af68a7f..59c73fbd695 100644
--- a/src/tools/opt-dist/src/training.rs
+++ b/src/tools/opt-dist/src/training.rs
@@ -81,7 +81,7 @@ fn merge_llvm_profiles(
     profdata: LlvmProfdata,
 ) -> anyhow::Result<()> {
     let llvm_profdata = match profdata {
-        LlvmProfdata::Host => env.downloaded_llvm_dir().join("bin/llvm-profdata"),
+        LlvmProfdata::Host => env.host_llvm_dir().join("bin/llvm-profdata"),
         LlvmProfdata::Target => env
             .build_artifacts()
             .join("llvm")