From af8a6049a50809b0f375ec66d1636a5703c83568 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 14 Apr 2021 19:11:17 +0300 Subject: Profile trait solving for all invocations --- crates/hir_ty/src/db.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'crates/hir_ty/src/db.rs') diff --git a/crates/hir_ty/src/db.rs b/crates/hir_ty/src/db.rs index 1690926ad..cf67d4266 100644 --- a/crates/hir_ty/src/db.rs +++ b/crates/hir_ty/src/db.rs @@ -128,13 +128,21 @@ pub trait HirDatabase: DefDatabase + Upcast { id: chalk_db::AssociatedTyValueId, ) -> Arc; - #[salsa::invoke(crate::traits::trait_solve_query)] + #[salsa::invoke(trait_solve_wait)] + #[salsa::transparent] fn trait_solve( &self, krate: CrateId, goal: crate::Canonical>, ) -> Option; + #[salsa::invoke(crate::traits::trait_solve_query)] + fn trait_solve_query( + &self, + krate: CrateId, + goal: crate::Canonical>, + ) -> Option; + #[salsa::invoke(chalk_db::program_clauses_for_chalk_env_query)] fn program_clauses_for_chalk_env( &self, @@ -156,6 +164,15 @@ fn infer_wait(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc db.infer_query(def) } +fn trait_solve_wait( + db: &dyn HirDatabase, + krate: CrateId, + goal: crate::Canonical>, +) -> Option { + let _p = profile::span("trait_solve::wait"); + db.trait_solve_query(krate, goal) +} + #[test] fn hir_database_is_object_safe() { fn _assert_object_safe(_: &dyn HirDatabase) {} -- cgit v1.2.3