GCC Middle and Back End API Reference
diagnostic-format-text.cc File Reference
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "version.h"
#include "intl.h"
#include "diagnostic.h"
#include "diagnostic-color.h"
#include "diagnostic-url.h"
#include "diagnostic-metadata.h"
#include "diagnostic-path.h"
#include "diagnostic-client-data-hooks.h"
#include "diagnostic-diagram.h"
#include "diagnostic-format-text.h"
#include "diagnostic-buffer.h"
#include "text-art/theme.h"
#include "make-unique.h"
Include dependency graph for diagnostic-format-text.cc:

Data Structures

class  diagnostic_text_format_buffer
 

Macros

#define INCLUDE_VECTOR
 

Functions

static unsigned get_bullet_point_unichar (bool unicode)
 
static bool use_unicode_p (const diagnostic_context &dc)
 
static unsigned get_bullet_point_unichar (diagnostic_context &dc)
 
const char * maybe_line_and_column (int line, int col)
 
void default_diagnostic_text_starter (diagnostic_text_output_format &text_output, const diagnostic_info *diagnostic)
 
void default_diagnostic_text_finalizer (diagnostic_text_output_format &text_output, const diagnostic_info *diagnostic, diagnostic_t)
 

Macro Definition Documentation

◆ INCLUDE_VECTOR

#define INCLUDE_VECTOR
Classic text-based output of diagnostics.
   Copyright (C) 1999-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   

Function Documentation

◆ default_diagnostic_text_finalizer()

◆ default_diagnostic_text_starter()

◆ get_bullet_point_unichar() [1/2]

static unsigned get_bullet_point_unichar ( bool unicode)
static
Get the unicode code point for bullet points when showing
nested diagnostics.   

Referenced by diagnostic_text_output_format::build_indent_prefix(), and get_bullet_point_unichar().

◆ get_bullet_point_unichar() [2/2]

static unsigned get_bullet_point_unichar ( diagnostic_context & dc)
static
Get the unicode code point for bullet points when showing
nested diagnostics.   

References get_bullet_point_unichar(), and use_unicode_p().

◆ maybe_line_and_column()

const char * maybe_line_and_column ( int line,
int col )
Helpers for writing lang-specific starters/finalizers for text output.   
Return a formatted line and column ':%line:%column'.  Elided if
line == 0 or col < 0.  (A column of 0 may be valid due to the
-fdiagnostics-column-origin option.)
The result is a statically allocated buffer.   

References gcc_checking_assert.

Referenced by diagnostic_column_policy::get_location_text(), and diagnostic_text_output_format::report_current_module().

◆ use_unicode_p()

static bool use_unicode_p ( const diagnostic_context & dc)
static
Return true if DC's theme supports unicode characters.   

References diagnostic_context::get_diagram_theme().

Referenced by get_bullet_point_unichar().