GCC Middle and Back End API Reference
diagnostic_source_print_policy Class Reference

#include <diagnostic.h>

Collaboration diagram for diagnostic_source_print_policy:

Public Member Functions

 diagnostic_source_print_policy (const diagnostic_context &)
 
 diagnostic_source_print_policy (const diagnostic_context &, const diagnostic_source_printing_options &)
 
void print (pretty_printer &pp, const rich_location &richloc, diagnostic_t diagnostic_kind, diagnostic_source_effect_info *effect_info) const
 
const diagnostic_source_printing_optionsget_options () const
 
diagnostic_start_span_fn get_start_span_fn () const
 
file_cacheget_file_cache () const
 
enum diagnostics_escape_format get_escape_format () const
 
text_art::theme * get_diagram_theme () const
 
const diagnostic_column_policyget_column_policy () const
 
const diagnostic_location_print_policyget_location_policy () const
 

Private Attributes

const diagnostic_source_printing_optionsm_options
 
class diagnostic_location_print_policy m_location_policy
 
diagnostic_start_span_fn m_start_span_cb
 
file_cachem_file_cache
 
text_art::theme * m_diagram_theme
 
enum diagnostics_escape_format m_escape_format
 

Detailed Description

A bundle of state for printing source within a diagnostic,
to isolate the interactions between diagnostic_context and the
implementation of diagnostic_show_locus.   

Constructor & Destructor Documentation

◆ diagnostic_source_print_policy() [1/2]

diagnostic_source_print_policy::diagnostic_source_print_policy ( const diagnostic_context & dc)

◆ diagnostic_source_print_policy() [2/2]

diagnostic_source_print_policy::diagnostic_source_print_policy ( const diagnostic_context & dc,
const diagnostic_source_printing_options & opts )

Member Function Documentation

◆ get_column_policy()

const diagnostic_column_policy & diagnostic_source_print_policy::get_column_policy ( ) const
inline

References m_location_policy.

◆ get_diagram_theme()

text_art::theme * diagnostic_source_print_policy::get_diagram_theme ( ) const
inline

◆ get_escape_format()

enum diagnostics_escape_format diagnostic_source_print_policy::get_escape_format ( ) const
inline

◆ get_file_cache()

file_cache & diagnostic_source_print_policy::get_file_cache ( ) const
inline

◆ get_location_policy()

const diagnostic_location_print_policy & diagnostic_source_print_policy::get_location_policy ( ) const
inline

References m_location_policy.

◆ get_options()

const diagnostic_source_printing_options & diagnostic_source_print_policy::get_options ( ) const
inline

References m_options.

◆ get_start_span_fn()

diagnostic_start_span_fn diagnostic_source_print_policy::get_start_span_fn ( ) const
inline

References m_start_span_cb.

◆ print()

void diagnostic_source_print_policy::print ( pretty_printer & pp,
const rich_location & richloc,
diagnostic_t diagnostic_kind,
diagnostic_source_effect_info * effects ) const
Print to PP the physical source code corresponding to the location(s)
in RICHLOC, with additional annotations, as if for a diagnostic of the
given DIAGNOSTIC_KIND.
If EFFECTS is non-null, then use and update it.   

Referenced by sarif_builder::make_location_object(), and diagnostic_context::maybe_show_locus().

Field Documentation

◆ m_diagram_theme

text_art::theme* diagnostic_source_print_policy::m_diagram_theme
private

◆ m_escape_format

enum diagnostics_escape_format diagnostic_source_print_policy::m_escape_format
private

◆ m_file_cache

file_cache& diagnostic_source_print_policy::m_file_cache
private

◆ m_location_policy

class diagnostic_location_print_policy diagnostic_source_print_policy::m_location_policy
private

◆ m_options

const diagnostic_source_printing_options& diagnostic_source_print_policy::m_options
private

◆ m_start_span_cb

diagnostic_start_span_fn diagnostic_source_print_policy::m_start_span_cb
private

The documentation for this class was generated from the following files: