Skip to content

Commit

Permalink
Rename method in opt-dist
Browse files Browse the repository at this point in the history
This makes it clearer that the LLVM is the host one (it doesn't necessarily have to be downloaded).
  • Loading branch information
Kobzol committed Aug 7, 2023
1 parent 03a119b commit 65e468f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/tools/opt-dist/src/environment/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
4 changes: 2 additions & 2 deletions src/tools/opt-dist/src/environment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/opt-dist/src/environment/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/opt-dist/src/training.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 65e468f

Please sign in to comment.