GCC Middle and Back End API Reference
|
Public Member Functions | |
html_builder (context &dc, pretty_printer &pp, const line_maps *line_maps, const html_generation_options &html_gen_opts) | |
void | dump (FILE *out, int indent) const |
void | set_main_input_filename (const char *name) |
void | on_report_diagnostic (const diagnostic_info &diagnostic, enum kind orig_diag_kind, html_sink_buffer *buffer) |
void | emit_diagram (const diagram &d) |
void | emit_global_graph (const lazily_created< digraphs::digraph > &) |
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 metadata &) |
std::unique_ptr< xml::element > | make_element_for_patch (const diagnostic_info &diagnostic) |
void | add_focus_id (std::string focus_id) |
std::unique_ptr< xml::node > | maybe_make_state_diagram (const paths::event &event) |
Private Member Functions | |
void | add_stylesheet (std::string url) |
std::unique_ptr< xml::element > | make_element_for_diagnostic (const diagnostic_info &diagnostic, enum kind 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 () |
void | add_graph (const digraphs::digraph &dg, xml::element &parent_element) |
Private Attributes | |
context & | m_context |
pretty_printer * | m_printer |
const line_maps * | m_line_maps |
html_generation_options | m_html_gen_opts |
const logical_locations::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_body_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_locations::key | m_last_logical_location |
location_t | m_last_location |
expanded_location | m_last_expanded_location |
Friends | |
class | html_sink_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
diagnostics::html_builder::html_builder | ( | context & | dc, |
pretty_printer & | pp, | ||
const line_maps * | line_maps, | ||
const html_generation_options & | html_gen_opts ) |
html_builder's ctor.
References m_body_element, 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 |
References diagnostics::add_nesting_level_attr(), xml::printer::append(), gcc_assert, xml::printer::get_insertion_point(), m_cur_diagnostic_element, m_cur_nesting_levels, pop_nesting_level(), xml::printer::pop_tag(), push_nesting_level(), and xml::printer::push_tag().
Referenced by on_report_diagnostic().
|
inline |
References m_ui_focus_ids.
Referenced by make_element_for_diagnostic().
|
private |
References xml::node_with_children::add_child(), xml::printer::add_text(), xml::printer::append(), diagnostics::digraphs::digraph::get_description(), diagnostics::digraphs::digraph::make_dot_graph(), dot::make_svg_from_graph(), xml::printer::pop_tag(), and xml::printer::push_tag().
Referenced by emit_global_graph(), and make_element_for_diagnostic().
|
private |
References gcc_assert, m_head_element, xml::printer::push_tag(), and xml::printer::set_attr().
void diagnostics::html_builder::dump | ( | FILE * | out, |
int | indent ) const |
References diagnostics::dumping::emit_heading(), and m_html_gen_opts.
void diagnostics::html_builder::emit_diagram | ( | const diagram & | d | ) |
Implementation of diagnostics::context::m_diagrams.m_emission_cb for HTML output.
References gcc_assert, and m_cur_diagnostic_element.
void diagnostics::html_builder::emit_global_graph | ( | const lazily_created< digraphs::digraph > & | ldg | ) |
References add_graph(), gcc_assert, lazily_created< T >::get_or_create(), and m_body_element.
void diagnostics::html_builder::end_group | ( | ) |
Implementation of "end_group_cb" for HTML output.
References m_cur_diagnostic_element, and m_diagnostics_element.
void diagnostics::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(), DIAGNOSTICS_LOG_SCOPE_PRINTF0, gcc_assert, m_context, 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_graph(), diagnostics::add_labelled_value(), xml::printer::add_text(), xml::printer::add_text_from_pp(), xml::printer::append(), diagnostics::column_policy::converted_column(), diagnostic_expand_location(), gcc_assert, diagnostics::client_data_hooks::get_current_logical_location(), xml::printer::get_insertion_point(), diagnostics::get_label_for_logical_location_kind(), diagnostics::metadata::get_lazy_digraphs(), xml::printer::get_num_open_tags(), diagnostics::get_pf_class_for_alert_div(), diagnostics::get_pf_class_for_alert_icon(), diagnostics::get_text_for_kind(), m_context, m_last_expanded_location, m_last_location, m_last_logical_location, m_logical_loc_mgr, diagnostic::m_metadata, m_next_diag_id, m_printer, diagnostics::make_div(), make_element_for_metadata(), make_element_for_patch(), diagnostics::make_span(), path, xml::printer::pop_tag(), pp_clear_output_area(), pp_formatted_text(), pp_output_formatted_text(), pp_printf(), pp_printf_n(), diagnostics::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 > diagnostics::html_builder::make_element_for_metadata | ( | const metadata & | m | ) |
std::unique_ptr< xml::element > diagnostics::html_builder::make_element_for_patch | ( | const diagnostic_info & | diagnostic | ) |
References diagnostics::changes::change_set::add_fixits(), free(), diagnostics::changes::change_set::generate_diff(), and m_context.
Referenced by make_element_for_diagnostic().
|
private |
References xml::printer::add_text(), diagnostics::make_span(), xml::printer::pop_tag(), xml::printer::push_tag(), and xml::printer::set_attr().
Referenced by make_element_for_metadata().
std::unique_ptr< xml::node > diagnostics::html_builder::maybe_make_state_diagram | ( | const paths::event & | event | ) |
void diagnostics::html_builder::on_report_diagnostic | ( | const diagnostic_info & | diagnostic, |
enum kind | orig_diag_kind, | ||
html_sink_buffer * | buffer ) |
Implementation of "on_report_diagnostic" for HTML output.
References add_at_nesting_level(), fnotice(), gcc_assert, html_sink_buffer, m_context, m_cur_diagnostic_element, m_cur_nesting_levels, m_last_logical_location, 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(), diagnostics::add_nesting_level_attr(), gcc_assert, m_cur_diagnostic_element, and m_cur_nesting_levels.
Referenced by add_at_nesting_level().
void diagnostics::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 html_sink_buffer.
Referenced by html_sink_buffer, and on_report_diagnostic().
|
private |
Referenced by emit_global_graph(), and html_builder().
|
private |
Referenced by flush_to_file(), 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 dump(), flush_to_file(), html_builder(), and maybe_make_state_diagram().
|
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(), make_element_for_diagnostic(), and maybe_make_state_diagram().
|
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().