|
GCC Middle and Back End API Reference
|
#include "config.h"#include "system.h"#include "coretypes.h"#include "intl.h"#include "diagnostic.h"#include "json-diagnostic.h"#include "diagnostics/dumping.h"#include "diagnostics/logging.h"#include "diagnostics/logical-locations.h"#include "diagnostics/client-data-hooks.h"#include "diagnostics/text-sink.h"#include "diagnostics/physical-location-maker.h"#include "pretty-print-markup.h"
Data Structures | |
| class | json_logical_location_manager |
| class | json_client_data_hooks |
| class | pp_markup::quoted_json_pointer |
Namespaces | |
| namespace | pp_markup |
Macros | |
| #define | INCLUDE_MAP |
| #define | INCLUDE_STRING |
| #define | INCLUDE_VECTOR |
Functions | |
| static bool | emit_json_diagnostic (gcc_json_context &ctxt, enum diagnostics::kind kind, const json::value &js_val, diagnostics::option_id option_id, const char *gmsgid, va_list *ap) ATTRIBUTE_GCC_DIAG(5 |
| static void | json_text_starter (diagnostics::text_sink &sink, const diagnostics::diagnostic_info *diagnostic) |
| void | json_error (gcc_json_context &ctxt, const json::value &js_val, const char *gmsgid,...) |
| bool | json_warning (gcc_json_context &ctxt, const json::value &js_val, diagnostics::option_id option_id, const char *gmsgid,...) |
| void | json_note (gcc_json_context &ctxt, const json::value &js_val, const char *gmsgid,...) |
| #define INCLUDE_MAP |
Diagnostics relating to JSON values. Copyright (C) 2026 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/>.
| #define INCLUDE_STRING |
| #define INCLUDE_VECTOR |
|
static |
Emit a diagnostic on global_dc of the relevant KIND relating to JS_VAL, using CTXT to get at file/line/column info. Temporarily override global_dc's logical location to refer to JS_VAL and the text_sink starter and finalizer to be suitable for handling reporting within a JSON file.
References ap, diagnostics::default_text_finalizer(), json::simple_location_map::get_range_for_value(), global_dc, json_text_starter(), line_table, diagnostics::logging::log_function_params::log_param_option_id(), diagnostics::logging::log_function_params::log_param_string(), and gcc_json_context::make_location_for_range().
Referenced by json_error(), json_note(), and json_warning().
| void json_error | ( | gcc_json_context & | ctxt, |
| const json::value & | js_val, | ||
| const char * | gmsgid, | ||
| ... ) |
Emit an error on gcc's global_dc relating to JS_VAL.
References ap, and emit_json_diagnostic().
| void json_note | ( | gcc_json_context & | ctxt, |
| const json::value & | js_val, | ||
| const char * | gmsgid, | ||
| ... ) |
Emit a note on gcc's global_dc relating to JS_VAL.
References ap, and emit_json_diagnostic().
Referenced by json_note().
|
static |
text_sink starter for diagnostics relating to JSON.
References _, diagnostic_location(), json::value::get_kind(), json::value::get_pointer_token(), json_logical_location_manager::js_from_key(), json::JSON_ARRAY, json::JSON_OBJECT, LOCATION_FILE, json::pointer::token::m_parent, pp_newline(), pp_printf(), and pp_set_prefix().
Referenced by emit_json_diagnostic().
| bool json_warning | ( | gcc_json_context & | ctxt, |
| const json::value & | js_val, | ||
| diagnostics::option_id | option_id, | ||
| const char * | gmsgid, | ||
| ... ) |
Emit a warning on gcc's global_dc relating to JS_VAL.
References ap, and emit_json_diagnostic().
Referenced by json_warning().