diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-18 10:30:43 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-18 10:30:43 +0000 |
commit | 5e6e89094796ffae1631509909287bdedc85797f (patch) | |
tree | 8da5e7988373b87010689497007a2740fab83f6b /crates/project_model | |
parent | 9eb37fbdeb4695eec4b30bfda1a9016b74b0d029 (diff) | |
parent | e13065b8aca98f99553b61129e776ae3688dbdfc (diff) |
Merge #7317
7317: Add profile call r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/project_model')
-rw-r--r-- | crates/project_model/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/project_model/src/workspace.rs | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/crates/project_model/Cargo.toml b/crates/project_model/Cargo.toml index 436eff16b..293cb5bfe 100644 --- a/crates/project_model/Cargo.toml +++ b/crates/project_model/Cargo.toml | |||
@@ -25,3 +25,4 @@ toolchain = { path = "../toolchain", version = "0.0.0" } | |||
25 | proc_macro_api = { path = "../proc_macro_api", version = "0.0.0" } | 25 | proc_macro_api = { path = "../proc_macro_api", version = "0.0.0" } |
26 | paths = { path = "../paths", version = "0.0.0" } | 26 | paths = { path = "../paths", version = "0.0.0" } |
27 | stdx = { path = "../stdx", version = "0.0.0" } | 27 | stdx = { path = "../stdx", version = "0.0.0" } |
28 | profile = { path = "../profile", version = "0.0.0" } | ||
diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs index 06a0be284..c511320d7 100644 --- a/crates/project_model/src/workspace.rs +++ b/crates/project_model/src/workspace.rs | |||
@@ -207,6 +207,7 @@ impl ProjectWorkspace { | |||
207 | proc_macro_client: Option<&ProcMacroClient>, | 207 | proc_macro_client: Option<&ProcMacroClient>, |
208 | load: &mut dyn FnMut(&AbsPath) -> Option<FileId>, | 208 | load: &mut dyn FnMut(&AbsPath) -> Option<FileId>, |
209 | ) -> CrateGraph { | 209 | ) -> CrateGraph { |
210 | let _p = profile::span("ProjectWorkspace::to_crate_graph"); | ||
210 | let proc_macro_loader = |path: &Path| match proc_macro_client { | 211 | let proc_macro_loader = |path: &Path| match proc_macro_client { |
211 | Some(client) => client.by_dylib_path(path), | 212 | Some(client) => client.by_dylib_path(path), |
212 | None => Vec::new(), | 213 | None => Vec::new(), |
@@ -299,6 +300,7 @@ fn cargo_to_crate_graph( | |||
299 | sysroot: &Sysroot, | 300 | sysroot: &Sysroot, |
300 | rustc: &Option<CargoWorkspace>, | 301 | rustc: &Option<CargoWorkspace>, |
301 | ) -> CrateGraph { | 302 | ) -> CrateGraph { |
303 | let _p = profile::span("cargo_to_crate_graph"); | ||
302 | let mut crate_graph = CrateGraph::default(); | 304 | let mut crate_graph = CrateGraph::default(); |
303 | let (public_deps, libproc_macro) = | 305 | let (public_deps, libproc_macro) = |
304 | sysroot_to_crate_graph(&mut crate_graph, sysroot, target, load); | 306 | sysroot_to_crate_graph(&mut crate_graph, sysroot, target, load); |
@@ -493,6 +495,7 @@ fn sysroot_to_crate_graph( | |||
493 | target: Option<&str>, | 495 | target: Option<&str>, |
494 | load: &mut dyn FnMut(&AbsPath) -> Option<FileId>, | 496 | load: &mut dyn FnMut(&AbsPath) -> Option<FileId>, |
495 | ) -> (Vec<(CrateName, CrateId)>, Option<CrateId>) { | 497 | ) -> (Vec<(CrateName, CrateId)>, Option<CrateId>) { |
498 | let _p = profile::span("sysroot_to_crate_graph"); | ||
496 | let mut cfg_options = CfgOptions::default(); | 499 | let mut cfg_options = CfgOptions::default(); |
497 | cfg_options.extend(get_rustc_cfg_options(target)); | 500 | cfg_options.extend(get_rustc_cfg_options(target)); |
498 | let sysroot_crates: FxHashMap<SysrootCrate, CrateId> = sysroot | 501 | let sysroot_crates: FxHashMap<SysrootCrate, CrateId> = sysroot |