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
+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
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));
}