From fe184be50cadbbca937c00d478df983909d5a19e Mon Sep 17 00:00:00 2001 From: csmoe Date: Fri, 6 Dec 2019 03:24:35 +0800 Subject: [PATCH] pgo: init --- src/bin/cargo/commands/build.rs | 1 + src/cargo/util/command_prelude.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/bin/cargo/commands/build.rs b/src/bin/cargo/commands/build.rs index df3a69c18d0..43c5cfa2b07 100644 --- a/src/bin/cargo/commands/build.rs +++ b/src/bin/cargo/commands/build.rs @@ -27,6 +27,7 @@ pub fn cli() -> App { "Build all targets", ) .arg_release("Build artifacts in release mode, with optimizations") + .arg_pgo("Build artifacts in release mode, with profile guide optimizations") .arg_profile("Build artifacts with the specified profile") .arg_features() .arg_target_triple("Build for the target triple") diff --git a/src/cargo/util/command_prelude.rs b/src/cargo/util/command_prelude.rs index bc233096a7f..efa371c36f5 100644 --- a/src/cargo/util/command_prelude.rs +++ b/src/cargo/util/command_prelude.rs @@ -116,6 +116,10 @@ pub trait AppExt: Sized { self._arg(opt("release", release)) } + fn arg_pgo(self, pgo: &'static str) -> Self { + self._arg(opt("pgo", pgo)) + } + fn arg_profile(self, profile: &'static str) -> Self { self._arg(opt("profile", profile).value_name("PROFILE-NAME")) }