Public Member Functions | |
sarif_code_flow (sarif_result &parent, unsigned idx_within_parent) | |
sarif_result & | get_parent () const |
unsigned | get_index_within_parent () const |
sarif_thread_flow & | get_or_append_thread_flow (const diagnostic_thread &thread, diagnostic_thread_id_t thread_id) |
sarif_thread_flow & | get_thread_flow (diagnostic_thread_id_t thread_id) |
void | add_location (sarif_thread_flow_location &) |
sarif_thread_flow_location & | get_thread_flow_loc_obj (diagnostic_event_id_t event_id) const |
sarif_property_bag & | get_or_create_properties () |
enum kind | get_kind () const final override |
void | print (pretty_printer *pp, bool formatted) const final override |
object * | dyn_cast_object () final override |
bool | is_empty () const |
void | set (const char *key, value *v) |
template<typename JsonType> | |
void | set (const char *key, std::unique_ptr< JsonType > v) |
value * | get (const char *key) const |
void | set_string (const char *key, const char *utf8_value) |
void | set_integer (const char *key, long v) |
void | set_float (const char *key, double v) |
void | set_bool (const char *key, bool v) |
void | dump (FILE *, bool formatted) const |
void DEBUG_FUNCTION | dump () const |
const pointer::token & | get_pointer_token () const |
Static Public Member Functions | |
static int | compare (const json::object &obj_a, const json::object &obj_b) |
static int | compare (const json::value &val_a, const json::value &val_b) |
Data Fields | |
pointer::token | m_pointer_token |
Private Types | |
typedef hash_map< char *, value *, simple_hashmap_traits< nofree_string_hash, value * > > | map_t |
Private Attributes | |
sarif_result & | m_parent |
const unsigned | m_idx_within_parent |
hash_map< int_hash< diagnostic_thread_id_t, -1, -2 >, sarif_thread_flow * > | m_thread_id_map |
json::array * | m_thread_flows_arr |
std::vector< sarif_thread_flow_location * > | m_all_tfl_objs |
map_t | m_map |
auto_vec< const char * > | m_keys |
Subclass of sarif_object for SARIF "codeFlow" objects (SARIF v2.1.0 section 3.36).
|
privateinherited |
sarif_code_flow::sarif_code_flow | ( | sarif_result & | parent, |
unsigned | idx_within_parent ) |
class sarif_code_flow : public sarif_object.
References m_idx_within_parent, m_parent, m_thread_flows_arr, and json::object::set().
void sarif_code_flow::add_location | ( | sarif_thread_flow_location & | tfl_obj | ) |
References m_all_tfl_objs.
|
staticinherited |
Subroutine of json::compare for comparing a pairs of objects.
References json::value::compare(), gcc_assert, get(), m_keys, and m_map.
Referenced by json::value::compare().
|
staticinherited |
A deterministic total ordering for comparing json values, so that we can e.g. put them in std::map. This is intended to follow the condition for equality described in the JSON Schema standard (§4.3, “Instance equality”), as referenced by SARIF v2.1.0 (§3.7.3 "Array properties with unique values"), but has the following limitations: - numbers are supposed to be checked for "the same mathematical value", but in this implementation int vs float numbers won't compare as equal, and float number comparison is bitwise - strings are supposed to be "the same codepoint-for-codepoint", but this implementation doesn't take into account canonicalization issues.
References json::object::compare(), compare(), gcc_unreachable, json::float_number::get(), json::integer_number::get(), get_kind(), json::string::get_string(), json::JSON_ARRAY, json::JSON_FALSE, json::JSON_FLOAT, json::JSON_INTEGER, json::JSON_NULL, json::JSON_OBJECT, json::JSON_STRING, json::JSON_TRUE, and json::array::size().
Referenced by json::object::compare(), compare(), and sarif_array_of_unique< JsonElementType >::comparator_t::operator()().
|
inherited |
A convenience function for debugging. Dump to stderr with formatting, and a trailing newline.
References dump().
|
inherited |
class json::value.
Dump this json::value tree to OUTF. The key/value pairs of json::objects are printed in the order in which the keys were originally inserted.
References output_buffer::m_stream, pp_buffer(), pp_flush(), and print().
Referenced by dump(), generate_results(), and sarif_serialization_format_json::write_to_file().
|
inlinefinaloverridevirtualinherited |
Reimplemented from json::value.
References final().
|
inherited |
Get the json::value * for KEY. The object retains ownership of the value.
References gcc_assert, get(), m_map, and NULL.
Referenced by compare(), get(), sarif_location::get_id(), sarif_code_flow::get_or_append_thread_flow(), sarif_object::get_or_create_properties(), sarif_location_relationship::get_target_id(), sarif_location_relationship::lazily_add_kind(), sarif_location::lazily_add_relationship_object(), sarif_location::lazily_add_relationships_array(), sarif_builder::make_location_object(), sarif_builder::make_location_object(), sarif_builder::make_location_object(), and sarif_location_manager::process_worklist_item().
|
inline |
References m_idx_within_parent.
Referenced by make_sarif_url_for_event().
|
inlinefinaloverridevirtualinherited |
Implements json::value.
References final(), and json::JSON_OBJECT.
sarif_thread_flow & sarif_code_flow::get_or_append_thread_flow | ( | const diagnostic_thread & | thread, |
diagnostic_thread_id_t | thread_id ) |
References json::object::get(), m_thread_flows_arr, and m_thread_id_map.
|
inherited |
class sarif_object : public json::object.
References json::object::get(), json::value::get_kind(), json::JSON_OBJECT, and json::object::set().
Referenced by sarif_ice_notification::sarif_ice_notification().
|
inline |
References m_parent.
Referenced by make_sarif_url_for_event().
|
inlineinherited |
References m_pointer_token.
sarif_thread_flow & sarif_code_flow::get_thread_flow | ( | diagnostic_thread_id_t | thread_id | ) |
References gcc_assert, and m_thread_id_map.
sarif_thread_flow_location & sarif_code_flow::get_thread_flow_loc_obj | ( | diagnostic_event_id_t | event_id | ) | const |
References gcc_assert, diagnostic_event_id_t::known_p(), m_all_tfl_objs, and diagnostic_event_id_t::zero_based().
Referenced by make_sarif_url_for_event().
|
finaloverridevirtualinherited |
Implementation of json::value::print for json::object.
Implements json::value.
References FOR_EACH_VEC_ELT, hash_map< KeyId, Value, Traits >::get(), i, m_keys, m_map, pp_character(), pp_indent(), pp_indentation(), pp_newline(), pp_space, pp_string(), json::value::print(), and print_escaped_json_string().
Referenced by generate_results().
|
inlineinherited |
References set().
|
inherited |
Set the json::value * for KEY, taking ownership of V (and taking a copy of KEY if necessary).
References gcc_assert, m_keys, m_map, and json::value::m_pointer_token.
Referenced by optrecord_json_writer::add_pass_list(), optrecord_json_writer::add_record(), sarif_location_manager::add_related_location(), compiler_data_hooks::add_sarif_invocation_properties(), generate_results(), sarif_builder::get_or_create_artifact(), sarif_object::get_or_create_properties(), optrecord_json_writer::inlining_chain_to_json(), json_set_prime_path_coverage(), sarif_location_relationship::lazily_add_kind(), sarif_location::lazily_add_relationships_array(), sarif_builder::make_fix_object(), sarif_builder::make_replacement_object(), sarif_builder::make_result_object(), sarif_builder::make_run_object(), sarif_builder::make_tool_object(), sarif_builder::make_top_level_object(), infinite_loop_diagnostic::maybe_add_sarif_properties(), sarif_builder::maybe_make_cwe_taxonomy_object(), sarif_builder::maybe_make_physical_location_object(), json_output_format::on_report_diagnostic(), optrecord_json_writer::optinfo_to_json(), optrecord_json_writer::optrecord_json_writer(), output_intermediate_json_line(), output_json_intermediate_file(), optrecord_json_writer::pass_to_json(), sarif_artifact::populate_contents(), sarif_artifact::populate_roles(), sarif_builder::populate_thread_flow_location_object(), sarif_invocation::prepare_to_flush(), sarif_code_flow::sarif_code_flow(), sarif_ice_notification::sarif_ice_notification(), sarif_invocation::sarif_invocation(), sarif_thread_flow::sarif_thread_flow(), set(), sarif_builder::set_any_logical_locs_arr(), set_bool(), set_float(), set_integer(), sarif_property_bag::set_logical_location(), and set_string().
|
inherited |
Set value of KEY within this object to the JSON literal true or false, based on V.
References set().
Referenced by sarif_builder::make_location_object(), json_output_format::on_report_diagnostic(), output_intermediate_json_line(), and sarif_invocation::prepare_to_flush().
|
inherited |
Set value of KEY within this object to a JSON floating point value based on V.
References set().
|
inherited |
Set value of KEY within this object to a JSON integer value based on V.
References set().
Referenced by optrecord_json_writer::impl_location_to_json(), json_set_prime_path_coverage(), sarif_location::lazily_add_id(), optrecord_json_writer::location_to_json(), infinite_recursion_diagnostic::maybe_add_sarif_properties(), sarif_result::on_nested_diagnostic(), json_output_format::on_report_diagnostic(), output_intermediate_json_line(), optrecord_json_writer::pass_to_json(), sarif_builder::populate_thread_flow_location_object(), optrecord_json_writer::profile_count_to_json(), and sarif_location_relationship::sarif_location_relationship().
|
inherited |
Set value of KEY within this object to a JSON string value based on UTF8_VALUE.
References set().
Referenced by generate_results(), sarif_builder::get_or_create_artifact(), optrecord_json_writer::impl_location_to_json(), optrecord_json_writer::inlining_chain_to_json(), json_set_prime_path_coverage(), optrecord_json_writer::location_to_json(), json_output_format::on_report_diagnostic(), optrecord_json_writer::optinfo_to_json(), optrecord_json_writer::optrecord_json_writer(), output_intermediate_json_line(), output_json_intermediate_file(), optrecord_json_writer::pass_to_json(), optrecord_json_writer::profile_count_to_json(), sarif_ice_notification::sarif_ice_notification(), sarif_thread_flow::sarif_thread_flow(), and set_string_property_escaping_braces().
|
private |
Referenced by add_location(), and get_thread_flow_loc_obj().
|
private |
Referenced by get_index_within_parent(), and sarif_code_flow().
|
privateinherited |
|
privateinherited |
|
private |
Referenced by get_parent(), and sarif_code_flow().
|
inherited |
Referenced by json::array::append(), get_pointer_token(), and json::object::set().
|
private |
Referenced by get_or_append_thread_flow(), and sarif_code_flow().
|
private |
Referenced by get_or_append_thread_flow(), and get_thread_flow().