@@ -9,6 +9,7 @@ use rustc_data_structures::sync::Lrc;
9
9
use rustc_errors:: ErrorGuaranteed ;
10
10
use rustc_parse:: nt_to_tokenstream;
11
11
use rustc_parse:: parser:: ForceCollect ;
12
+ use rustc_span:: profiling:: SpannedEventArgRecorder ;
12
13
use rustc_span:: { Span , DUMMY_SP } ;
13
14
14
15
const EXEC_STRATEGY : pm:: bridge:: server:: SameThread = pm:: bridge:: server:: SameThread ;
@@ -25,7 +26,10 @@ impl base::ProcMacro for BangProcMacro {
25
26
input : TokenStream ,
26
27
) -> Result < TokenStream , ErrorGuaranteed > {
27
28
let _timer =
28
- ecx. sess . prof . generic_activity_with_arg ( "expand_proc_macro" , ecx. expansion_descr ( ) ) ;
29
+ ecx. sess . prof . generic_activity_with_arg_recorder ( "expand_proc_macro" , |recorder| {
30
+ recorder. record_arg_with_span ( ecx. expansion_descr ( ) , span) ;
31
+ } ) ;
32
+
29
33
let proc_macro_backtrace = ecx. ecfg . proc_macro_backtrace ;
30
34
let server = proc_macro_server:: Rustc :: new ( ecx) ;
31
35
self . client . run ( & EXEC_STRATEGY , server, input, proc_macro_backtrace) . map_err ( |e| {
@@ -51,7 +55,10 @@ impl base::AttrProcMacro for AttrProcMacro {
51
55
annotated : TokenStream ,
52
56
) -> Result < TokenStream , ErrorGuaranteed > {
53
57
let _timer =
54
- ecx. sess . prof . generic_activity_with_arg ( "expand_proc_macro" , ecx. expansion_descr ( ) ) ;
58
+ ecx. sess . prof . generic_activity_with_arg_recorder ( "expand_proc_macro" , |recorder| {
59
+ recorder. record_arg_with_span ( ecx. expansion_descr ( ) , span) ;
60
+ } ) ;
61
+
55
62
let proc_macro_backtrace = ecx. ecfg . proc_macro_backtrace ;
56
63
let server = proc_macro_server:: Rustc :: new ( ecx) ;
57
64
self . client
@@ -103,7 +110,9 @@ impl MultiItemModifier for ProcMacroDerive {
103
110
104
111
let stream = {
105
112
let _timer =
106
- ecx. sess . prof . generic_activity_with_arg ( "expand_proc_macro" , ecx. expansion_descr ( ) ) ;
113
+ ecx. sess . prof . generic_activity_with_arg_recorder ( "expand_proc_macro" , |recorder| {
114
+ recorder. record_arg_with_span ( ecx. expansion_descr ( ) , span) ;
115
+ } ) ;
107
116
let proc_macro_backtrace = ecx. ecfg . proc_macro_backtrace ;
108
117
let server = proc_macro_server:: Rustc :: new ( ecx) ;
109
118
match self . client . run ( & EXEC_STRATEGY , server, input, proc_macro_backtrace) {
0 commit comments