libstdc++: Refactor loops in std::__platform_semaphore
[official-gcc.git] / gcc / diagnostic-label-effects.h
blobe640f3d1a1fe0eb5ccf02d734f220ab2986665c7
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>.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #ifndef GCC_DIAGNOSTIC_LABEL_EFFECTS_H
22 #define GCC_DIAGNOSTIC_LABEL_EFFECTS_H
24 /* Abstract base class for describing special effects when printing
25 a label when quoting source code. */
27 class label_effects
29 public:
30 virtual ~label_effects () {}
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;
38 /* A class to hold state when quoting a run of lines of source code. */
40 class diagnostic_source_effect_info
42 public:
43 diagnostic_source_effect_info ()
44 : m_leading_in_edge_column (-1),
45 m_trailing_out_edge_column (-1)
49 /* The column for an incoming link to the first label,
50 or -1 if no such link. */
51 int m_leading_in_edge_column;
53 /* The column for an outgoing link from the final label,
54 or -1 if no such link. */
55 int m_trailing_out_edge_column;
58 #endif /* GCC_DIAGNOSTIC_LABEL_EFFECTS_H */