Skip to content

Commit ec7d2bb

Browse files
Add/Fix macro expansion profiling
1 parent 0993f90 commit ec7d2bb

File tree

1 file changed

+4
-2
lines changed
  • crates/hir_expand/src

1 file changed

+4
-2
lines changed

crates/hir_expand/src/db.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ fn macro_expand_with_arg(
189189
id: MacroCallId,
190190
arg: Option<Arc<(tt::Subtree, mbe::TokenMap)>>,
191191
) -> ExpandResult<Option<Arc<tt::Subtree>>> {
192+
let _p = profile::span("macro_expand");
192193
let lazy_id = match id {
193194
MacroCallId::LazyMacro(id) => id,
194195
MacroCallId::EagerMacro(id) => {
@@ -276,14 +277,15 @@ fn parse_macro_with_arg(
276277
macro_file: MacroFile,
277278
arg: Option<Arc<(tt::Subtree, mbe::TokenMap)>>,
278279
) -> ExpandResult<Option<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)>> {
279-
let _p = profile::span("parse_macro_query");
280-
281280
let macro_call_id = macro_file.macro_call_id;
282281
let result = if let Some(arg) = arg {
283282
macro_expand_with_arg(db, macro_call_id, Some(arg))
284283
} else {
285284
db.macro_expand(macro_call_id)
286285
};
286+
287+
let _p = profile::span("parse_macro_expansion");
288+
287289
if let Some(err) = &result.err {
288290
// Note:
289291
// The final goal we would like to make all parse_macro success,

0 commit comments

Comments
 (0)