GCC Middle and Back End API Reference
diagnostic-label-effects.h
Go to the documentation of this file.
1/* Classes for adding special effects when quoting source code.
2 Copyright (C) 2024 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_DIAGNOSTIC_LABEL_EFFECTS_H
22#define GCC_DIAGNOSTIC_LABEL_EFFECTS_H
23
24/* Abstract base class for describing special effects when printing
25 a label when quoting source code. */
26
28{
29public:
30 virtual ~label_effects () {}
31
32 /* Adding links between labels, e.g. for visualizing control flow
33 in execution paths. */
34 virtual bool has_in_edge (unsigned range_idx) const = 0;
35 virtual bool has_out_edge (unsigned range_idx) const = 0;
36};
37
38/* A class to hold state when quoting a run of lines of source code. */
39
41{
42public:
48
49 /* The column for an incoming link to the first label,
50 or -1 if no such link. */
52
53 /* The column for an outgoing link from the final label,
54 or -1 if no such link. */
56};
57
58#endif /* GCC_DIAGNOSTIC_LABEL_EFFECTS_H */
Definition diagnostic-label-effects.h:41
int m_leading_in_edge_column
Definition diagnostic-label-effects.h:51
diagnostic_source_effect_info()
Definition diagnostic-label-effects.h:43
int m_trailing_out_edge_column
Definition diagnostic-label-effects.h:55
Definition diagnostic-label-effects.h:28
virtual ~label_effects()
Definition diagnostic-label-effects.h:30
virtual bool has_out_edge(unsigned range_idx) const =0
virtual bool has_in_edge(unsigned range_idx) const =0