GCC Middle and Back End API Reference
source-printing-options.h
Go to the documentation of this file.
1/* Options relating to printing the user's source code.
2 Copyright (C) 2000-2025 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_DIAGNOSTICS_SOURCE_PRINTING_OPTIONS_H
21#define GCC_DIAGNOSTICS_SOURCE_PRINTING_OPTIONS_H
22
23namespace diagnostics {
24
25/* A bundle of options relating to printing the user's source code
26 (potentially with a margin, underlining, labels, etc). */
27
29{
30 /* True if we should print the source line with a caret indicating
31 the location.
32 Corresponds to -fdiagnostics-show-caret. */
33 bool enabled;
34
35 /* Maximum width of the source line printed. */
37
38 /* Character used at the caret when printing source locations. */
39 char caret_chars[rich_location::STATICALLY_ALLOCATED_RANGES];
40
41 /* When printing source code, should the characters at carets and ranges
42 be colorized? (assuming colorization is on at all).
43 This should be true for frontends that generate range information
44 (so that the ranges of code are colorized),
45 and false for frontends that merely specify points within the
46 source code (to avoid e.g. colorizing just the first character in
47 a token, which would look strange). */
49
50 /* When printing source code, should labelled ranges be printed?
51 Corresponds to -fdiagnostics-show-labels. */
53
54 /* When printing source code, should there be a left-hand margin
55 showing line numbers?
56 Corresponds to -fdiagnostics-show-line-numbers. */
58
59 /* If printing source code, what should the minimum width of the margin
60 be? Line numbers will be right-aligned, and padded to this width.
61 Corresponds to -fdiagnostics-minimum-margin-width=VALUE. */
63
64 /* Usable by plugins; if true, print a debugging ruler above the
65 source output. */
67
68 /* When printing events in an inline path, should we print lines
69 visualizing links between related events (e.g. for CFG paths)?
70 Corresponds to -fdiagnostics-show-event-links. */
72};
73
74} // namespace diagnostics
75
76#endif /* ! GCC_DIAGNOSTICS_SOURCE_PRINTING_OPTIONS_H */
Definition coretypes.h:167
Definition source-printing-options.h:29
bool enabled
Definition source-printing-options.h:33
bool show_labels_p
Definition source-printing-options.h:52
bool show_ruler_p
Definition source-printing-options.h:66
int max_width
Definition source-printing-options.h:36
bool show_event_links_p
Definition source-printing-options.h:71
char caret_chars[rich_location::STATICALLY_ALLOCATED_RANGES]
Definition source-printing-options.h:39
bool colorize_source_p
Definition source-printing-options.h:48
bool show_line_numbers_p
Definition source-printing-options.h:57
int min_margin_width
Definition source-printing-options.h:62