diff options
Diffstat (limited to 'gcc/diagnostics/context-options.h')
-rw-r--r-- | gcc/diagnostics/context-options.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/gcc/diagnostics/context-options.h b/gcc/diagnostics/context-options.h new file mode 100644 index 0000000..c4e92eb --- /dev/null +++ b/gcc/diagnostics/context-options.h @@ -0,0 +1,116 @@ +/* Declare enums for diagnostics::context and related types. + Copyright (C) 2000-2025 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/>. */ + +#ifndef GCC_DIAGNOSTICS_CONTEXT_OPTIONS_H +#define GCC_DIAGNOSTICS_CONTEXT_OPTIONS_H + +/* An enum for controlling what units to use for the column number + when diagnostics are output, used by the -fdiagnostics-column-unit option. + Tabs will be expanded or not according to the value of -ftabstop. The origin + (default 1) is controlled by -fdiagnostics-column-origin. */ + +enum diagnostics_column_unit +{ + /* The default from GCC 11 onwards: display columns. */ + DIAGNOSTICS_COLUMN_UNIT_DISPLAY, + + /* The behavior in GCC 10 and earlier: simple bytes. */ + DIAGNOSTICS_COLUMN_UNIT_BYTE +}; + +/* An enum for controlling how to print non-ASCII characters/bytes when + a diagnostic suggests escaping the source code on output. */ + +enum diagnostics_escape_format +{ + /* Escape non-ASCII Unicode characters in the form <U+XXXX> and + non-UTF-8 bytes in the form <XX>. */ + DIAGNOSTICS_ESCAPE_FORMAT_UNICODE, + + /* Escape non-ASCII bytes in the form <XX> (thus showing the underlying + encoding of non-ASCII Unicode characters). */ + DIAGNOSTICS_ESCAPE_FORMAT_BYTES +}; + +/* Enum for overriding the standard output format. */ + +enum diagnostics_output_format +{ + /* The default: textual output. */ + DIAGNOSTICS_OUTPUT_FORMAT_TEXT, + + /* SARIF-based output, as JSON to stderr. */ + DIAGNOSTICS_OUTPUT_FORMAT_SARIF_STDERR, + + /* SARIF-based output, to a JSON file. */ + DIAGNOSTICS_OUTPUT_FORMAT_SARIF_FILE +}; + +/* An enum for controlling how diagnostic paths should be printed. */ +enum diagnostic_path_format +{ + /* Don't print diagnostic paths. */ + DPF_NONE, + + /* Print diagnostic paths by emitting a separate "note" for every event + in the path. */ + DPF_SEPARATE_EVENTS, + + /* Print diagnostic paths by consolidating events together where they + are close enough, and printing such runs of events with multiple + calls to diagnostic_show_locus, showing the individual events in + each run via labels in the source. */ + DPF_INLINE_EVENTS +}; + +/* An enum for capturing values of GCC_EXTRA_DIAGNOSTIC_OUTPUT, + and for -fdiagnostics-parseable-fixits. */ + +enum diagnostics_extra_output_kind +{ + /* No extra output, or an unrecognized value. */ + EXTRA_DIAGNOSTIC_OUTPUT_none, + + /* Emit fix-it hints using the "fixits-v1" format, equivalent to + -fdiagnostics-parseable-fixits. */ + EXTRA_DIAGNOSTIC_OUTPUT_fixits_v1, + + /* Emit fix-it hints using the "fixits-v2" format. */ + EXTRA_DIAGNOSTIC_OUTPUT_fixits_v2 +}; + +/* Values for -fdiagnostics-text-art-charset=. */ + +enum diagnostic_text_art_charset +{ + /* No text art diagrams shall be emitted. */ + DIAGNOSTICS_TEXT_ART_CHARSET_NONE, + + /* Use pure ASCII for text art diagrams. */ + DIAGNOSTICS_TEXT_ART_CHARSET_ASCII, + + /* Use ASCII + conservative use of other unicode characters + in text art diagrams. */ + DIAGNOSTICS_TEXT_ART_CHARSET_UNICODE, + + /* Use Emoji. */ + DIAGNOSTICS_TEXT_ART_CHARSET_EMOJI +}; + +#endif /* ! GCC_DIAGNOSTICS_CONTEXT_OPTIONS_H */ |