diff options
author | Richard Biener <rguenther@suse.de> | 2021-10-05 11:41:42 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-10-05 12:35:40 +0200 |
commit | eded91050982dc4d7968fecf65469f1ef68854f9 (patch) | |
tree | 80bc4bab51db9af40a4ce00df0d5a58514a46692 /gcc/tree-cfg.c | |
parent | 604459a09585314841cdce4698893c656481691b (diff) | |
download | gcc-eded91050982dc4d7968fecf65469f1ef68854f9.zip gcc-eded91050982dc4d7968fecf65469f1ef68854f9.tar.gz gcc-eded91050982dc4d7968fecf65469f1ef68854f9.tar.bz2 |
Amend function names with UID when dumping with TDF_UID
The following makes sure to amend more function names with the
associated DECL_UID when dumping with TDF_UID, in particular
function names printed as part of calls and in the function header.
That allows one to more easily follow the call flow of PR102528
where coroutines cause three clones of the name 'test2' that are
not distinguishable otherwise.
2021-10-05 Richard Biener <rguenther@suse.de>
* tree-cfg.c (dump_function_to_file): Dump the UID of the
function as part of the name when requested.
* tree-pretty-print.c (dump_function_name): Dump the UID when
requested and the langhook produced the actual name.
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 367dcfa..4b4b0b5 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -8127,14 +8127,22 @@ dump_function_to_file (tree fndecl, FILE *file, dump_flags_t flags) fprintf (file, ",%s(%" PRIu64 ")", profile_quality_as_string (bb->count.quality ()), bb->count.value ()); - fprintf (file, ")\n%s (", function_name (fun)); + if (dump_flags & TDF_UID) + fprintf (file, ")\n%sD_%u (", function_name (fun), + DECL_UID (fndecl)); + else + fprintf (file, ")\n%s (", function_name (fun)); } } else { print_generic_expr (file, TREE_TYPE (fntype), dump_flags); - fprintf (file, " %s %s(", function_name (fun), - tmclone ? "[tm-clone] " : ""); + if (dump_flags & TDF_UID) + fprintf (file, " %sD.%u %s(", function_name (fun), DECL_UID (fndecl), + tmclone ? "[tm-clone] " : ""); + else + fprintf (file, " %s %s(", function_name (fun), + tmclone ? "[tm-clone] " : ""); } arg = DECL_ARGUMENTS (fndecl); |