mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 21:54:42 +00:00
Auto merge of #18208 - davidbarsky:davidbarsky/push-qkwkmttnukqt, r=lnicola
internal: allow overriding proc macro server in analysis-stats Needed this argument in order to profile the proc macro expansion server (c.f., [this Zulip conversation](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/.60macro_rules!.60-based.20macros.20for.20derives.2Fattributes/near/473466794)). I also took the opportunity to change the phrasing for `--proc-macro-srv`. Ran with `samply record ~/.cargo/bin/rust-analyzer analysis-stats --proc-macro-srv /Users/dbarsky/.cargo/bin/rust-analyzer-proc-macro-srv --parallel .` on rust-analyzer itself.
This commit is contained in:
commit
792e79566d
2 changed files with 12 additions and 3 deletions
|
@ -81,7 +81,13 @@ impl flags::AnalysisStats {
|
|||
with_proc_macro_server: if self.disable_proc_macros {
|
||||
ProcMacroServerChoice::None
|
||||
} else {
|
||||
ProcMacroServerChoice::Sysroot
|
||||
match self.proc_macro_srv {
|
||||
Some(ref path) => {
|
||||
let path = vfs::AbsPathBuf::assert_utf8(path.to_owned());
|
||||
ProcMacroServerChoice::Explicit(path)
|
||||
}
|
||||
None => ProcMacroServerChoice::Sysroot,
|
||||
}
|
||||
},
|
||||
prefill_caches: false,
|
||||
};
|
||||
|
|
|
@ -76,6 +76,8 @@ xflags::xflags! {
|
|||
optional --disable-build-scripts
|
||||
/// Don't use expand proc macros.
|
||||
optional --disable-proc-macros
|
||||
/// Run the proc-macro-srv binary at the specified path.
|
||||
optional --proc-macro-srv path: PathBuf
|
||||
/// Skip body lowering.
|
||||
optional --skip-lowering
|
||||
/// Skip type inference.
|
||||
|
@ -120,7 +122,7 @@ xflags::xflags! {
|
|||
optional --disable-build-scripts
|
||||
/// Don't use expand proc macros.
|
||||
optional --disable-proc-macros
|
||||
/// Run a custom proc-macro-srv binary.
|
||||
/// Run the proc-macro-srv binary at the specified path.
|
||||
optional --proc-macro-srv path: PathBuf
|
||||
}
|
||||
|
||||
|
@ -133,7 +135,7 @@ xflags::xflags! {
|
|||
optional --disable-build-scripts
|
||||
/// Don't use expand proc macros.
|
||||
optional --disable-proc-macros
|
||||
/// Run a custom proc-macro-srv binary.
|
||||
/// Run the proc-macro-srv binary at the specified path.
|
||||
optional --proc-macro-srv path: PathBuf
|
||||
}
|
||||
|
||||
|
@ -233,6 +235,7 @@ pub struct AnalysisStats {
|
|||
pub no_sysroot: bool,
|
||||
pub disable_build_scripts: bool,
|
||||
pub disable_proc_macros: bool,
|
||||
pub proc_macro_srv: Option<PathBuf>,
|
||||
pub skip_lowering: bool,
|
||||
pub skip_inference: bool,
|
||||
pub skip_mir_stats: bool,
|
||||
|
|
Loading…
Reference in a new issue