diff options
author | David Malcolm <dmalcolm@redhat.com> | 2019-03-28 14:40:56 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2019-03-28 14:40:56 +0000 |
commit | 12b9247b19b8b634ec467ba8a3f506a4e7b76711 (patch) | |
tree | dc36cb802fc35ebe41ae2a4b02a98cc678ef4bfb /gcc | |
parent | cdd82c1ee8d2ae036a4bfe2170b7795c17394109 (diff) | |
download | gcc-12b9247b19b8b634ec467ba8a3f506a4e7b76711.zip gcc-12b9247b19b8b634ec467ba8a3f506a4e7b76711.tar.gz gcc-12b9247b19b8b634ec467ba8a3f506a4e7b76711.tar.bz2 |
optinfo-emit-json.cc: don't call get_fnname_from_decl (PR middle-end/89725)
optrecord_json_writer::optinfo_to_json can in theory be called from any
optimization pass, but currently uses get_fnname_from_decl, which
is RTL-specific.
In that PR, Jakub suggested using either DECL_ASSEMBLER_NAME or the
"printable name" (via current_function_name).
This patch makes it use DECL_ASSEMBLER_NAME.
gcc/ChangeLog:
PR middle-end/89725
* optinfo-emit-json.cc (optrecord_json_writer::optinfo_to_json):
Use DECL_ASSEMBLER_NAME rather than get_fnname_from_decl.
From-SVN: r269994
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/optinfo-emit-json.cc | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50ed3df..741639d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-03-28 David Malcolm <dmalcolm@redhat.com> + + PR middle-end/89725 + * optinfo-emit-json.cc (optrecord_json_writer::optinfo_to_json): + Use DECL_ASSEMBLER_NAME rather than get_fnname_from_decl. + 2019-03-28 Jakub Jelinek <jakub@redhat.com> * regcprop.c (copyprop_hardreg_forward_1): Remove redundant INSN_P diff --git a/gcc/optinfo-emit-json.cc b/gcc/optinfo-emit-json.cc index 814446b..1cfcdfe 100644 --- a/gcc/optinfo-emit-json.cc +++ b/gcc/optinfo-emit-json.cc @@ -411,7 +411,8 @@ optrecord_json_writer::optinfo_to_json (const optinfo *optinfo) if (current_function_decl) { - const char *fnname = get_fnname_from_decl (current_function_decl); + const char *fnname + = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)); obj->set ("function", new json::string (fnname)); } |