Skip to content

Commit 8fa22dd

Browse files
Add self-profiling to debuginfo name generation
1 parent bdd09c3 commit 8fa22dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ pub fn compute_debuginfo_type_name<'tcx>(
3434
t: Ty<'tcx>,
3535
qualified: bool,
3636
) -> String {
37+
let _prof = tcx.prof.generic_activity("compute_debuginfo_type_name");
38+
3739
let mut result = String::with_capacity(64);
3840
let mut visited = FxHashSet::default();
3941
push_debuginfo_type_name(tcx, t, qualified, &mut result, &mut visited);
@@ -42,7 +44,7 @@ pub fn compute_debuginfo_type_name<'tcx>(
4244

4345
// Pushes the name of the type as it should be stored in debuginfo on the
4446
// `output` String. See also compute_debuginfo_type_name().
45-
pub fn push_debuginfo_type_name<'tcx>(
47+
fn push_debuginfo_type_name<'tcx>(
4648
tcx: TyCtxt<'tcx>,
4749
t: Ty<'tcx>,
4850
qualified: bool,
@@ -577,6 +579,7 @@ fn push_const_param<'tcx>(tcx: TyCtxt<'tcx>, ct: &'tcx ty::Const<'tcx>, output:
577579
}
578580

579581
pub fn push_generic_params<'tcx>(tcx: TyCtxt<'tcx>, substs: SubstsRef<'tcx>, output: &mut String) {
582+
let _prof = tcx.prof.generic_activity("compute_debuginfo_type_name");
580583
let mut visited = FxHashSet::default();
581584
push_generic_params_internal(tcx, substs, output, &mut visited);
582585
}

0 commit comments

Comments
 (0)