From b8d50a7414389a237eeaa67e575a5374da698300 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 27 Jan 2021 12:16:24 +0300 Subject: add more counts --- crates/hir_def/src/body.rs | 2 ++ crates/hir_def/src/body/lower.rs | 2 ++ crates/hir_expand/src/ast_id_map.rs | 4 +++- crates/profile/Cargo.toml | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/hir_def/src/body.rs b/crates/hir_def/src/body.rs index d0c84ab0b..b9ecf22fa 100644 --- a/crates/hir_def/src/body.rs +++ b/crates/hir_def/src/body.rs @@ -17,6 +17,7 @@ use hir_expand::{ HirFileId, InFile, MacroDefId, }; use la_arena::{Arena, ArenaMap}; +use profile::Count; use rustc_hash::FxHashMap; use syntax::{ast, AstNode, AstPtr}; use test_utils::mark; @@ -237,6 +238,7 @@ pub struct Body { /// The `ExprId` of the actual body expression. pub body_expr: ExprId, pub item_scope: ItemScope, + _c: Count, } pub type ExprPtr = AstPtr; diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs index 4ce5e5b72..209965fca 100644 --- a/crates/hir_def/src/body/lower.rs +++ b/crates/hir_def/src/body/lower.rs @@ -10,6 +10,7 @@ use hir_expand::{ ExpandError, HirFileId, MacroDefId, MacroDefKind, }; use la_arena::Arena; +use profile::Count; use rustc_hash::FxHashMap; use syntax::{ ast::{ @@ -77,6 +78,7 @@ pub(super) fn lower( params: Vec::new(), body_expr: dummy_expr_id(), item_scope: Default::default(), + _c: Count::new(), }, item_trees: { let mut map = FxHashMap::default(); diff --git a/crates/hir_expand/src/ast_id_map.rs b/crates/hir_expand/src/ast_id_map.rs index 0991fffd8..16cf29907 100644 --- a/crates/hir_expand/src/ast_id_map.rs +++ b/crates/hir_expand/src/ast_id_map.rs @@ -13,6 +13,7 @@ use std::{ }; use la_arena::{Arena, Idx}; +use profile::Count; use syntax::{ast, match_ast, AstNode, AstPtr, SyntaxNode, SyntaxNodePtr}; /// `AstId` points to an AST node in a specific file. @@ -62,12 +63,13 @@ type ErasedFileAstId = Idx; #[derive(Debug, PartialEq, Eq, Default)] pub struct AstIdMap { arena: Arena, + _c: Count, } impl AstIdMap { pub(crate) fn from_source(node: &SyntaxNode) -> AstIdMap { assert!(node.parent().is_none()); - let mut res = AstIdMap { arena: Arena::default() }; + let mut res = AstIdMap::default(); // By walking the tree in breadth-first order we make sure that parents // get lower ids then children. That is, adding a new child does not // change parent's id. This means that, say, adding a new function to a diff --git a/crates/profile/Cargo.toml b/crates/profile/Cargo.toml index 4dd9acc98..486f9c164 100644 --- a/crates/profile/Cargo.toml +++ b/crates/profile/Cargo.toml @@ -14,7 +14,7 @@ once_cell = "1.3.1" cfg-if = "1" libc = "0.2.73" la-arena = { version = "0.2.0", path = "../../lib/arena" } -countme = { version = "2.0.0", features = ["enable"] } +countme = { version = "2.0.1", features = ["enable"] } jemalloc-ctl = { version = "0.3.3", optional = true } [target.'cfg(target_os = "linux")'.dependencies] -- cgit v1.2.3