GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "diagnostic.h"
#include "selftest-diagnostic.h"
#include "diagnostic-metadata.h"
#include "json.h"
#include "selftest.h"
#include "diagnostic.def"
Data Structures | |
class | json_output_format |
class | json_stderr_output_format |
class | json_file_output_format |
Macros | |
#define | DEFINE_DIAGNOSTIC_KIND(K, T, C) (T), |
Functions | |
json::value * | json_from_expanded_location (diagnostic_context *context, location_t loc) |
static json::object * | json_from_location_range (diagnostic_context *context, const location_range *loc_range, unsigned range_idx) |
static json::object * | json_from_fixit_hint (diagnostic_context *context, const fixit_hint *hint) |
static json::object * | json_from_metadata (const diagnostic_metadata *metadata) |
static void | diagnostic_output_format_init_json (diagnostic_context *context) |
void | diagnostic_output_format_init_json_stderr (diagnostic_context *context, bool formatted) |
void | diagnostic_output_format_init_json_file (diagnostic_context *context, bool formatted, const char *base_file_name) |
|
static |
Populate CONTEXT in preparation for JSON output (either to stderr, or to a file).
References diagnostic_context::m_print_path, pp_show_color, diagnostic_context::printer, diagnostic_context::set_show_cwe(), diagnostic_context::set_show_option_requested(), and diagnostic_context::set_show_rules().
Referenced by diagnostic_output_format_init_json_file(), and diagnostic_output_format_init_json_stderr().
void diagnostic_output_format_init_json_file | ( | diagnostic_context * | context, |
bool | formatted, | ||
const char * | base_file_name ) |
Populate CONTEXT in preparation for JSON output to a file named BASE_FILE_NAME.gcc.json.
References base_file_name(), diagnostic_output_format_init_json(), ggc_alloc(), and diagnostic_context::set_output_format().
Referenced by diagnostic_output_format_init().
void diagnostic_output_format_init_json_stderr | ( | diagnostic_context * | context, |
bool | formatted ) |
Populate CONTEXT in preparation for JSON output to stderr.
References diagnostic_output_format_init_json(), ggc_alloc(), and diagnostic_context::set_output_format().
Referenced by diagnostic_output_format_init().
json::value * json_from_expanded_location | ( | diagnostic_context * | context, |
location_t | loc ) |
Generate a JSON object for LOC.
References diagnostic_context::converted_column(), DIAGNOSTICS_COLUMN_UNIT_BYTE, DIAGNOSTICS_COLUMN_UNIT_DISPLAY, expand_location(), gcc_assert, ggc_alloc(), i, INT_MIN, diagnostic_context::m_column_unit, json::object::set_integer(), and json::object::set_string().
Referenced by default_tree_make_json_for_path(), json_from_fixit_hint(), and json_from_location_range().
|
static |
Generate a JSON object for HINT.
References ggc_alloc(), and json_from_expanded_location().
Referenced by json_output_format::on_end_diagnostic().
|
static |
Generate a JSON object for LOC_RANGE.
References get_finish(), get_pure_location(), get_start(), ggc_alloc(), json_from_expanded_location(), NULL, json::object::set(), json::object::set_string(), and UNKNOWN_LOCATION.
Referenced by json_output_format::on_end_diagnostic().
|
static |
Generate a JSON object for METADATA.
References diagnostic_metadata::get_cwe(), and ggc_alloc().
Referenced by json_output_format::on_end_diagnostic().