Line data Source code
1 : /* Various declarations for language-independent diagnostics subroutines.
2 : Copyright (C) 2000-2026 Free Software Foundation, Inc.
3 :
4 : This file is part of GCC.
5 :
6 : GCC is free software; you can redistribute it and/or modify it under
7 : the terms of the GNU General Public License as published by the Free
8 : Software Foundation; either version 3, or (at your option) any later
9 : version.
10 :
11 : GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 : WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 : FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 : for more details.
15 :
16 : You should have received a copy of the GNU General Public License
17 : along with GCC; see the file COPYING3. If not see
18 : <http://www.gnu.org/licenses/>. */
19 :
20 : #ifndef GCC_DIAGNOSTICS_DIAGNOSTIC_INFO_H
21 : #define GCC_DIAGNOSTICS_DIAGNOSTIC_INFO_H
22 :
23 : namespace diagnostics {
24 :
25 : class metadata;
26 :
27 : /* A diagnostic is described by the MESSAGE to send, the FILE and LINE of
28 : its context and its KIND (ice, error, warning, note, ...) See complete
29 : list in diagnostics/kinds.def. */
30 :
31 224995294 : struct diagnostic_info
32 : {
33 112498367 : diagnostic_info ()
34 112498367 : : m_message (),
35 112498367 : m_richloc (),
36 112498367 : m_metadata (),
37 112498367 : m_x_data (),
38 112498367 : m_kind (),
39 112498367 : m_option_id (),
40 112498367 : m_iinfo ()
41 112498367 : { }
42 :
43 : /* Text to be formatted. */
44 : text_info m_message;
45 :
46 : /* The location at which the diagnostic is to be reported. */
47 : rich_location *m_richloc;
48 :
49 : /* An optional bundle of metadata associated with the diagnostic
50 : (or NULL). */
51 : const metadata *m_metadata;
52 :
53 : /* Auxiliary data for client. */
54 : void *m_x_data;
55 : /* The kind of diagnostic it is about. */
56 : kind m_kind;
57 : /* Which OPT_* directly controls this diagnostic. */
58 : option_id m_option_id;
59 :
60 : /* Inlining context containing locations for each call site along
61 : the inlining stack. */
62 112497647 : struct inlining_info
63 : {
64 : /* Locations along the inlining stack. */
65 : auto_vec<location_t, 8> m_ilocs;
66 : /* The abstract origin of the location. */
67 : void *m_ao;
68 : /* Set if every M_ILOCS element is in a system header. */
69 : bool m_allsyslocs;
70 : } m_iinfo;
71 : };
72 :
73 : } // namespace diagnostics
74 :
75 : #endif /* ! GCC_DIAGNOSTICS_DIAGNOSTIC_INFO_H */
|