GCC Middle and Back End API Reference
source-printing-effects.h
Go to the documentation of this file.
1/* Classes for adding special effects when quoting source code.
2 Copyright (C) 2024-2025 Free Software Foundation, Inc.
3 Contributed by David Malcolm <dmalcolm@redhat.com>.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it
8under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful, but
13WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_DIAGNOSTICS_SOURCE_PRINTING_EFFECTS_H
22#define GCC_DIAGNOSTICS_SOURCE_PRINTING_EFFECTS_H
23
24namespace diagnostics {
25
26/* Abstract base class for describing special effects when printing
27 a label when quoting source code. */
28
30{
31public:
32 virtual ~label_effects () {}
33
34 /* Adding links between labels, e.g. for visualizing control flow
35 in execution paths. */
36 virtual bool has_in_edge (unsigned range_idx) const = 0;
37 virtual bool has_out_edge (unsigned range_idx) const = 0;
38};
39
40/* A class to hold state when quoting a run of lines of source code. */
41
43{
44public:
50
51 /* The column for an incoming link to the first label,
52 or -1 if no such link. */
54
55 /* The column for an outgoing link from the final label,
56 or -1 if no such link. */
58};
59
60} // namespace diagnostics
61
62#endif /* GCC_DIAGNOSTICS_SOURCE_PRINTING_EFFECTS_H */
Definition source-printing-effects.h:30
virtual bool has_in_edge(unsigned range_idx) const =0
virtual bool has_out_edge(unsigned range_idx) const =0
virtual ~label_effects()
Definition source-printing-effects.h:32
int m_leading_in_edge_column
Definition source-printing-effects.h:53
source_effect_info()
Definition source-printing-effects.h:45
int m_trailing_out_edge_column
Definition source-printing-effects.h:57
Definition coretypes.h:167