GCC Middle and Back End API Reference
option-id-manager.h
Go to the documentation of this file.
1/* Hooks for giving client-specific meaning to option ids.
2 Copyright (C) 2000-2025 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along 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
23namespace diagnostics {
24
25/* Abstract base class for the diagnostic subsystem to make queries
26 about command-line options. */
27
29{
30public:
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 */
Definition option-id-manager.h:29
virtual char * make_option_name(option_id opt_id, enum kind orig_diag_kind, enum kind diag_kind) const =0
virtual int option_enabled_p(option_id opt_id) const =0
virtual char * make_option_url(option_id opt_id) const =0
virtual ~option_id_manager()
Definition option-id-manager.h:31
Definition coretypes.h:167
kind
Definition kinds.h:27
Definition option-id.h:32