Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'xtask/src/flags.rs')
| -rw-r--r-- | xtask/src/flags.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs index d03e2f8437..700806d178 100644 --- a/xtask/src/flags.rs +++ b/xtask/src/flags.rs @@ -59,6 +59,8 @@ xflags::xflags! { optional --client-patch-version version: String /// Use cargo-zigbuild optional --zig + /// Apply PGO optimizations + optional --pgo pgo: PgoTrainingCrate } /// Read a changelog AsciiDoc file and update the GitHub Releases entry in Markdown. cmd publish-release-notes { @@ -142,11 +144,31 @@ pub struct RustcPush { } #[derive(Debug)] +pub enum PgoTrainingCrate { + // Use RA's own sources for PGO training + RustAnalyzer, + // Download a Rust crate from `https://github.com/{0}` and use it for PGO training. + GitHub(String), +} + +impl FromStr for PgoTrainingCrate { + type Err = String; + + fn from_str(s: &str) -> Result<Self, Self::Err> { + match s { + "rust-analyzer" => Ok(Self::RustAnalyzer), + url => Ok(Self::GitHub(url.to_owned())), + } + } +} + +#[derive(Debug)] pub struct Dist { pub mimalloc: bool, pub jemalloc: bool, pub client_patch_version: Option<String>, pub zig: bool, + pub pgo: Option<PgoTrainingCrate>, } #[derive(Debug)] |