3724: Cleanup memory usage stats r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-03-25 18:36:37 +00:00 committed by GitHub
commit 402bf53a09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 11 deletions

View File

@ -10,15 +10,16 @@
TraitDataQuery, TypeAliasDataQuery, UnionDataQuery,
};
pub use hir_expand::db::{
AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternMacroQuery, MacroArgQuery, MacroDefQuery,
MacroExpandQuery, ParseMacroQuery,
AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery,
MacroArgQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery,
};
pub use hir_ty::db::{
AssociatedTyDataQuery, AssociatedTyValueQuery, CallableItemSignatureQuery, FieldTypesQuery,
GenericDefaultsQuery, GenericPredicatesForParamQuery, GenericPredicatesQuery, HirDatabase,
HirDatabaseStorage, ImplDatumQuery, ImplSelfTyQuery, ImplTraitQuery, ImplsForTraitQuery,
ImplsInCrateQuery, InferQueryQuery, InternAssocTyValueQuery, InternChalkImplQuery,
InternTypeCtorQuery, StructDatumQuery, TraitDatumQuery, TraitSolveQuery, TyQuery, ValueTyQuery,
InternTypeCtorQuery, InternTypeParamIdQuery, StructDatumQuery, TraitDatumQuery,
TraitSolveQuery, TyQuery, ValueTyQuery,
};
#[test]

View File

@ -48,6 +48,7 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast<dyn AstDatabase> {
fn raw_items(&self, file_id: HirFileId) -> Arc<RawItems>;
#[salsa::invoke(crate_def_map_wait)]
#[salsa::transparent]
fn crate_def_map(&self, krate: CrateId) -> Arc<CrateDefMap>;
#[salsa::invoke(CrateDefMap::crate_def_map_query)]
@ -109,12 +110,6 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast<dyn AstDatabase> {
fn documentation(&self, def: AttrDefId) -> Option<Documentation>;
}
// impl<T: DefDatabase> Upcast<dyn AstDatabase> for T {
// fn upcast(&self) -> &dyn AstDatabase {
// &*self
// }
// }
fn crate_def_map_wait(db: &impl DefDatabase, krate: CrateId) -> Arc<CrateDefMap> {
let _p = profile("crate_def_map:wait");
db.crate_def_map_query(krate)

View File

@ -22,6 +22,7 @@
#[salsa::requires(salsa::Database)]
pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
#[salsa::invoke(infer_wait)]
#[salsa::transparent]
fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>;
#[salsa::invoke(crate::infer::infer_query)]

View File

@ -311,6 +311,7 @@ macro_rules! sweep_each_query {
hir::db::MacroDefQuery
hir::db::ParseMacroQuery
hir::db::MacroExpandQuery
hir::db::InternEagerExpansionQuery
// DefDatabase
hir::db::RawItemsQuery
@ -359,14 +360,21 @@ macro_rules! sweep_each_query {
hir::db::ImplsInCrateQuery
hir::db::ImplsForTraitQuery
hir::db::InternTypeCtorQuery
hir::db::InternTypeParamIdQuery
hir::db::InternChalkImplQuery
hir::db::InternAssocTyValueQuery
hir::db::AssociatedTyDataQuery
hir::db::AssociatedTyValueQuery
hir::db::TraitSolveQuery
hir::db::TraitDatumQuery
hir::db::StructDatumQuery
hir::db::ImplDatumQuery
hir::db::AssociatedTyValueQuery
hir::db::TraitSolveQuery
// SymbolsDatabase
crate::symbol_index::FileSymbolsQuery
// LineIndexDatabase
crate::LineIndexQuery
];
acc.sort_by_key(|it| std::cmp::Reverse(it.1));
acc