GCC Middle and Back End API Reference
opts-diagnostic.h
Go to the documentation of this file.
1/* Command line option handling. Interactions with diagnostics code.
2 Copyright (C) 2010-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_OPTS_DIAGNOSTIC_H
21#define GCC_OPTS_DIAGNOSTIC_H
22
23/* Abstract subclass of diagnostics::option_id_manager for gcc options. */
24
26{
27public:
28 char *make_option_url (diagnostics::option_id option_id) const final override;
29
30protected:
32 : m_lang_mask (lang_mask)
33 {}
34
35 unsigned m_lang_mask;
36};
37
38/* Concrete implementation of diagnostics::option_id_manager for compiler. */
39
42{
43public:
45 unsigned lang_mask,
46 void *opts)
48 m_context (context),
49 m_opts (opts)
50 {
51 }
52
53 int option_enabled_p (diagnostics::option_id option_id) const final override;
54 char *
56 enum diagnostics::kind orig_diag_kind,
57 enum diagnostics::kind diag_kind) const final override;
58
59private:
61 void *m_opts;
62};
63
64extern void
65handle_OPT_fdiagnostics_add_output_ (const gcc_options &opts,
67 const char *arg,
68 location_t loc);
69
70extern void
71handle_OPT_fdiagnostics_set_output_ (const gcc_options &opts,
73 const char *arg,
74 location_t loc);
75#endif
void * m_opts
Definition opts-diagnostic.h:61
compiler_diagnostic_option_id_manager(const diagnostics::context &context, unsigned lang_mask, void *opts)
Definition opts-diagnostic.h:44
int option_enabled_p(diagnostics::option_id option_id) const final override
Definition opts-common.cc:1881
const diagnostics::context & m_context
Definition opts-diagnostic.h:60
char * make_option_name(diagnostics::option_id option_id, enum diagnostics::kind orig_diag_kind, enum diagnostics::kind diag_kind) const final override
Definition opts.cc:3775
Definition diagnostics/context.h:254
Definition option-id-manager.h:29
gcc_diagnostic_option_id_manager(unsigned lang_mask)
Definition opts-diagnostic.h:31
char * make_option_url(diagnostics::option_id option_id) const final override
Definition opts.cc:3854
unsigned m_lang_mask
Definition opts-diagnostic.h:35
kind
Definition kinds.h:27
void handle_OPT_fdiagnostics_set_output_(const gcc_options &opts, diagnostics::context &dc, const char *arg, location_t loc)
Definition opts-diagnostic.cc:94
void handle_OPT_fdiagnostics_add_output_(const gcc_options &opts, diagnostics::context &dc, const char *arg, location_t loc)
Definition opts-diagnostic.cc:73
Definition option-id.h:32