mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Merge #6652
6652: Add/Fix macro expansion profiling r=jonas-schievink a=jonas-schievink
bors r+ 🤖
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
commit
b6dd2c6cbd
1 changed files with 4 additions and 2 deletions
|
@ -189,6 +189,7 @@ fn macro_expand_with_arg(
|
|||
id: MacroCallId,
|
||||
arg: Option<Arc<(tt::Subtree, mbe::TokenMap)>>,
|
||||
) -> ExpandResult<Option<Arc<tt::Subtree>>> {
|
||||
let _p = profile::span("macro_expand");
|
||||
let lazy_id = match id {
|
||||
MacroCallId::LazyMacro(id) => id,
|
||||
MacroCallId::EagerMacro(id) => {
|
||||
|
@ -276,14 +277,15 @@ fn parse_macro_with_arg(
|
|||
macro_file: MacroFile,
|
||||
arg: Option<Arc<(tt::Subtree, mbe::TokenMap)>>,
|
||||
) -> ExpandResult<Option<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)>> {
|
||||
let _p = profile::span("parse_macro_query");
|
||||
|
||||
let macro_call_id = macro_file.macro_call_id;
|
||||
let result = if let Some(arg) = arg {
|
||||
macro_expand_with_arg(db, macro_call_id, Some(arg))
|
||||
} else {
|
||||
db.macro_expand(macro_call_id)
|
||||
};
|
||||
|
||||
let _p = profile::span("parse_macro_expansion");
|
||||
|
||||
if let Some(err) = &result.err {
|
||||
// Note:
|
||||
// The final goal we would like to make all parse_macro success,
|
||||
|
|
Loading…
Reference in a new issue