Skip to content

Commit 07b2c97

Browse files
authored
Rollup merge of rust-lang#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: rust-lang#114344 (comment) r? `@lqd`
2 parents 418b91a + 65e468f commit 07b2c97

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Diff for: src/tools/opt-dist/src/environment/linux.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl Environment for LinuxEnvironment {
1414
Utf8PathBuf::from("/checkout")
1515
}
1616

17-
fn downloaded_llvm_dir(&self) -> Utf8PathBuf {
17+
fn host_llvm_dir(&self) -> Utf8PathBuf {
1818
Utf8PathBuf::from("/rustroot")
1919
}
2020

Diff for: src/tools/opt-dist/src/environment/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub trait Environment {
1515
/// The rustc checkout, where the compiler source is located.
1616
fn checkout_path(&self) -> Utf8PathBuf;
1717

18-
/// Path to the downloaded host LLVM.
19-
fn downloaded_llvm_dir(&self) -> Utf8PathBuf;
18+
/// Path to the host LLVM used to compile LLVM in `src/llvm-project`.
19+
fn host_llvm_dir(&self) -> Utf8PathBuf;
2020

2121
/// Directory where the optimization artifacts (PGO/BOLT profiles, etc.)
2222
/// will be stored.

Diff for: src/tools/opt-dist/src/environment/windows.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl Environment for WindowsEnvironment {
2424
self.checkout_dir.clone()
2525
}
2626

27-
fn downloaded_llvm_dir(&self) -> Utf8PathBuf {
27+
fn host_llvm_dir(&self) -> Utf8PathBuf {
2828
self.checkout_path().join("citools").join("clang-rust")
2929
}
3030

Diff for: src/tools/opt-dist/src/training.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn merge_llvm_profiles(
8181
profdata: LlvmProfdata,
8282
) -> anyhow::Result<()> {
8383
let llvm_profdata = match profdata {
84-
LlvmProfdata::Host => env.downloaded_llvm_dir().join("bin/llvm-profdata"),
84+
LlvmProfdata::Host => env.host_llvm_dir().join("bin/llvm-profdata"),
8585
LlvmProfdata::Target => env
8686
.build_artifacts()
8787
.join("llvm")

0 commit comments

Comments
 (0)