Branch data Line data Source code
1 : : /* Hooks for giving client-specific meaning to option ids.
2 : : Copyright (C) 2000-2025 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_OPTION_ID_MANAGER_H
21 : : #define GCC_DIAGNOSTICS_OPTION_ID_MANAGER_H
22 : :
23 : : namespace diagnostics {
24 : :
25 : : /* Abstract base class for the diagnostic subsystem to make queries
26 : : about command-line options. */
27 : :
28 : 302343 : class option_id_manager
29 : : {
30 : : public:
31 : : virtual ~option_id_manager () {}
32 : :
33 : : /* Return 1 if option OPT_ID is enabled, 0 if it is disabled,
34 : : or -1 if it isn't a simple on-off switch
35 : : (or if the value is unknown, typically set later in target). */
36 : : virtual int option_enabled_p (option_id opt_id) const = 0;
37 : :
38 : : /* Return malloced memory for the name of the option OPT_ID
39 : : which enabled a diagnostic, originally of type ORIG_DIAG_KIND but
40 : : possibly converted to DIAG_KIND by options such as -Werror.
41 : : May return NULL if no name is to be printed.
42 : : May be passed 0 as well as the index of a particular option. */
43 : : virtual char *make_option_name (option_id opt_id,
44 : : enum kind orig_diag_kind,
45 : : enum kind diag_kind) const = 0;
46 : :
47 : : /* Return malloced memory for a URL describing the option that controls
48 : : a diagnostic.
49 : : May return NULL if no URL is available.
50 : : May be passed 0 as well as the index of a particular option. */
51 : : virtual char *make_option_url (option_id opt_id) const = 0;
52 : : };
53 : :
54 : : } // namespace diagnostics
55 : :
56 : : #endif /* ! GCC_DIAGNOSTICS_OPTION_ID_MANAGER_H */
|