GCC Middle and Back End API Reference
|
Public Member Functions | |
html_builder (diagnostic_context &context, pretty_printer &pp, const line_maps *line_maps, const html_generation_options &html_gen_opts) | |
void | set_main_input_filename (const char *name) |
void | on_report_diagnostic (const diagnostic_info &diagnostic, diagnostic_t orig_diag_kind, diagnostic_html_format_buffer *buffer) |
void | emit_diagram (const diagnostic_diagram &diagram) |
void | end_group () |
std::unique_ptr< xml::element > | take_current_diagnostic () |
void | flush_to_file (FILE *outf) |
const xml::document & | get_document () const |
void | set_printer (pretty_printer &pp) |
std::unique_ptr< xml::element > | make_element_for_metadata (const diagnostic_metadata &metadata) |
std::unique_ptr< xml::element > | make_element_for_patch (const diagnostic_info &diagnostic) |
void | add_focus_id (std::string focus_id) |
Private Member Functions | |
void | add_stylesheet (std::string url) |
std::unique_ptr< xml::element > | make_element_for_diagnostic (const diagnostic_info &diagnostic, diagnostic_t orig_diag_kind, bool alert) |
std::unique_ptr< xml::element > | make_metadata_element (label_text label, label_text url) |
void | add_at_nesting_level (size_t nesting_level, std::unique_ptr< xml::element > child_diag_element) |
void | push_nesting_level () |
void | pop_nesting_level () |
Private Attributes | |
diagnostic_context & | m_context |
pretty_printer * | m_printer |
const line_maps * | m_line_maps |
html_generation_options | m_html_gen_opts |
const logical_location_manager * | m_logical_loc_mgr |
std::unique_ptr< xml::document > | m_document |
xml::element * | m_head_element |
xml::element * | m_title_element |
xml::element * | m_diagnostics_element |
std::unique_ptr< xml::element > | m_cur_diagnostic_element |
std::vector< xml::element * > | m_cur_nesting_levels |
int | m_next_diag_id |
json::array | m_ui_focus_ids |
logical_location | m_last_logical_location |
location_t | m_last_location |
expanded_location | m_last_expanded_location |
Friends | |
class | diagnostic_html_format_buffer |
A class for managing HTML output of diagnostics. Implemented: - message text Known limitations/missing functionality: - title for page - file/line/column - error vs warning - CWEs - rules - fix-it hints - paths
html_builder::html_builder | ( | diagnostic_context & | context, |
pretty_printer & | pp, | ||
const line_maps * | line_maps, | ||
const html_generation_options & | html_gen_opts ) |
html_builder's ctor.
References m_context, m_diagnostics_element, m_head_element, m_html_gen_opts, m_last_expanded_location, m_last_location, m_line_maps, m_logical_loc_mgr, m_next_diag_id, m_printer, m_title_element, and UNKNOWN_LOCATION.
|
private |
|
inline |
References m_ui_focus_ids.
Referenced by make_element_for_diagnostic().
|
private |
References gcc_assert, m_head_element, xml::printer::push_tag(), and xml::printer::set_attr().
void html_builder::emit_diagram | ( | const diagnostic_diagram & | diagram | ) |
Implementation of diagnostic_context::m_diagrams.m_emission_cb for HTML output.
References gcc_assert, and m_cur_diagnostic_element.
void html_builder::end_group | ( | ) |
Implementation of "end_group_cb" for HTML output.
References m_cur_diagnostic_element, and m_diagnostics_element.
void html_builder::flush_to_file | ( | FILE * | outf | ) |
Create a top-level object, and add it to all the results (and other entities) we've seen so far. Flush it all to OUTF.
References xml::printer::add_raw(), gcc_assert, m_document, m_head_element, m_html_gen_opts, m_ui_focus_ids, xml::printer::pop_tag(), pp_formatted_text(), pp_string(), and xml::printer::push_tag().
|
inline |
References m_document.
|
private |
Make a <div class="gcc-diagnostic"> for DIAGNOSTIC. If ALERT is true, make it be a PatternFly alert (see https://pf3.patternfly.org/v3/pattern-library/widgets/#alerts) and show severity text (e.g. "error: "). If ALERT is false, don't show the severity text and don't show the filename if it's the same as the previous diagnostic within the diagnostic group.
References _, add_focus_id(), add_labelled_value(), xml::printer::add_text(), xml::printer::add_text_from_pp(), xml::printer::append(), diagnostic_column_policy::converted_column(), diagnostic_expand_location(), gcc_assert, get_diagnostic_kind_text(), xml::printer::get_insertion_point(), get_label_for_logical_location_kind(), xml::printer::get_num_open_tags(), get_pf_class_for_alert_div(), get_pf_class_for_alert_icon(), m_context, m_last_expanded_location, m_last_location, m_last_logical_location, m_logical_loc_mgr, m_next_diag_id, m_printer, make_div(), make_element_for_metadata(), make_element_for_patch(), make_span(), path, xml::printer::pop_tag(), pp_clear_output_area(), pp_formatted_text(), pp_output_formatted_text(), pp_printf(), pp_printf_n(), print_path_as_html(), xml::printer::push_tag(), xml::printer::push_tag_with_class(), and xml::printer::set_attr().
Referenced by on_report_diagnostic().
std::unique_ptr< xml::element > html_builder::make_element_for_metadata | ( | const diagnostic_metadata & | metadata | ) |
std::unique_ptr< xml::element > html_builder::make_element_for_patch | ( | const diagnostic_info & | diagnostic | ) |
References edit_context::add_fixits(), element, free(), edit_context::generate_diff(), and m_context.
Referenced by make_element_for_diagnostic().
|
private |
References xml::printer::add_text(), make_span(), xml::printer::pop_tag(), xml::printer::push_tag(), and xml::printer::set_attr().
Referenced by make_element_for_metadata().
void html_builder::on_report_diagnostic | ( | const diagnostic_info & | diagnostic, |
diagnostic_t | orig_diag_kind, | ||
diagnostic_html_format_buffer * | buffer ) |
Implementation of "on_report_diagnostic" for HTML output.
References add_at_nesting_level(), diagnostic_html_format_buffer, fnotice(), gcc_assert, m_context, m_cur_diagnostic_element, m_cur_nesting_levels, m_last_logical_location, diagnostic_html_format_buffer::m_results, and make_element_for_diagnostic().
|
private |
References gcc_assert, m_cur_diagnostic_element, and m_cur_nesting_levels.
Referenced by add_at_nesting_level().
|
private |
References xml::node_with_children::add_child(), add_nesting_level_attr(), gcc_assert, m_cur_diagnostic_element, and m_cur_nesting_levels.
Referenced by add_at_nesting_level().
void html_builder::set_main_input_filename | ( | const char * | name | ) |
References gcc_assert, and m_title_element.
|
inline |
References m_printer.
|
inline |
References m_cur_diagnostic_element.
|
friend |
References diagnostic_html_format_buffer.
Referenced by diagnostic_html_format_buffer, and on_report_diagnostic().
|
private |
Referenced by html_builder(), make_element_for_diagnostic(), make_element_for_patch(), and on_report_diagnostic().
|
private |
|
private |
Referenced by add_at_nesting_level(), on_report_diagnostic(), pop_nesting_level(), and push_nesting_level().
|
private |
Referenced by end_group(), and html_builder().
|
private |
Referenced by flush_to_file(), and get_document().
|
private |
Referenced by add_stylesheet(), flush_to_file(), and html_builder().
|
private |
Referenced by flush_to_file(), and html_builder().
|
private |
Referenced by html_builder(), and make_element_for_diagnostic().
|
private |
Referenced by html_builder(), and make_element_for_diagnostic().
|
private |
Referenced by make_element_for_diagnostic(), and on_report_diagnostic().
|
private |
Referenced by html_builder().
|
private |
Referenced by html_builder(), and make_element_for_diagnostic().
|
private |
Referenced by html_builder(), and make_element_for_diagnostic().
|
private |
Referenced by html_builder(), make_element_for_diagnostic(), and set_printer().
|
private |
Referenced by html_builder(), and set_main_input_filename().
|
private |
Referenced by add_focus_id(), and flush_to_file().