GCC Middle and Back End API Reference
|
Public Member Functions | |
void | on_begin_group () final override |
void | on_end_group () final override |
void | on_begin_diagnostic (const diagnostic_info &) final override |
void | on_end_diagnostic (const diagnostic_info &diagnostic, diagnostic_t orig_diag_kind) final override |
void | on_diagram (const diagnostic_diagram &) final override |
virtual bool | machine_readable_stderr_p () const =0 |
Protected Member Functions | |
json_output_format (diagnostic_context &context, bool formatted) | |
void | flush_to_file (FILE *outf) |
Protected Attributes | |
diagnostic_context & | m_context |
Private Attributes | |
json::array * | m_toplevel_array |
json::object * | m_cur_group |
json::array * | m_cur_children_array |
bool | m_formatted |
JSON output for diagnostics Copyright (C) 2018-2024 Free Software Foundation, Inc. Contributed by David Malcolm <dmalcolm@redhat.com>. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Subclass of diagnostic_output_format for JSON output.
|
inlineprotected |
References json::value::dump(), ggc_alloc(), m_formatted, and m_toplevel_array.
Referenced by json_file_output_format::~json_file_output_format(), and json_stderr_output_format::~json_stderr_output_format().
|
inlinefinaloverridevirtual |
Implements diagnostic_output_format.
|
inlinefinaloverridevirtual |
Implements diagnostic_output_format.
|
inlinefinaloverridevirtual |
Implements diagnostic_output_format.
|
finaloverridevirtual |
Implementation of "on_end_diagnostic" vfunc for JSON output. Generate a JSON object for DIAGNOSTIC, and store for output within current diagnostic group.
Implements diagnostic_output_format.
References json::array::append(), diagnostic_kind_text, free(), gcc_assert, ggc_alloc(), i, json_from_fixit_hint(), json_from_location_range(), json_from_metadata(), diagnostic_context::m_column_origin, diagnostic_output_format::m_context, m_cur_children_array, m_cur_group, diagnostic_context::m_make_json_for_path, m_toplevel_array, diagnostic_context::make_option_name(), diagnostic_context::make_option_url(), pp_clear_output_area(), pp_formatted_text(), and diagnostic_context::printer.
|
inlinefinaloverridevirtual |
Implements diagnostic_output_format.
References m_cur_children_array, and m_cur_group.
|
protectedinherited |
Referenced by sarif_output_format::on_diagram(), on_end_diagnostic(), and sarif_output_format::on_end_diagnostic().
|
private |
Referenced by on_end_diagnostic(), and on_end_group().
|
private |
Referenced by on_end_diagnostic(), and on_end_group().
|
private |
Referenced by flush_to_file().
|
private |
Referenced by flush_to_file(), and on_end_diagnostic().