GCC Middle and Back End API Reference
diagnostic_column_policy Class Reference

#include <diagnostic.h>

Collaboration diagram for diagnostic_column_policy:

Public Member Functions

 diagnostic_column_policy (const diagnostic_context &dc)
int converted_column (expanded_location s) const
label_text get_location_text (const expanded_location &s, bool show_column, bool colorize) const
int get_tabstop () const

Private Attributes

file_cachem_file_cache
enum diagnostics_column_unit m_column_unit
int m_column_origin
int m_tabstop

Detailed Description

A bundle of state for determining column numbers in diagnostics (tab stops, whether to start at 0 or 1, etc). Uses a file_cache to handle tabs.

Constructor & Destructor Documentation

◆ diagnostic_column_policy()

diagnostic_column_policy::diagnostic_column_policy ( const diagnostic_context & dc)

Member Function Documentation

◆ converted_column()

int diagnostic_column_policy::converted_column ( expanded_location s) const
Given an expanded_location, convert the column (which is in 1-based bytes) to the requested units and origin. Return -1 if the column is invalid (<= 0).

References convert_column_unit(), m_column_origin, m_column_unit, m_file_cache, and m_tabstop.

Referenced by get_location_text(), and html_builder::make_element_for_diagnostic().

◆ get_location_text()

label_text diagnostic_column_policy::get_location_text ( const expanded_location & s,
bool show_column,
bool colorize ) const

◆ get_tabstop()

int diagnostic_column_policy::get_tabstop ( ) const
inline

References m_tabstop.

Field Documentation

◆ m_column_origin

int diagnostic_column_policy::m_column_origin
private

◆ m_column_unit

enum diagnostics_column_unit diagnostic_column_policy::m_column_unit
private

◆ m_file_cache

file_cache& diagnostic_column_policy::m_file_cache
private

◆ m_tabstop

int diagnostic_column_policy::m_tabstop
private

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