aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-01-18 10:25:57 +0000
committerAleksey Kladov <[email protected]>2021-01-18 10:30:12 +0000
commite13065b8aca98f99553b61129e776ae3688dbdfc (patch)
treef6c7a86721334f65e5104b6882028ccdc21eaa20 /crates/project_model/src
parentfde4a860aea903a0455a05c1def1d07a6573639b (diff)
Add profile call
Diffstat (limited to 'crates/project_model/src')
-rw-r--r--crates/project_model/src/workspace.rs3
1 files changed, 3 insertions, 0 deletions
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