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 diagnostic_option_manager for gcc options. */
24
26{
27public:
28 char *make_option_url (diagnostic_option_id option_id) const final override;
29
30protected:
31 gcc_diagnostic_option_manager (unsigned lang_mask)
32 : m_lang_mask (lang_mask)
33 {}
34
35 unsigned m_lang_mask;
36};
37
38/* Concrete implementation of diagnostic_option_manager for compiler. */
39
41{
42public:
44 unsigned lang_mask,
45 void *opts)
47 m_context (context),
48 m_opts (opts)
49 {
50 }
51
52 int option_enabled_p (diagnostic_option_id option_id) const final override;
54 diagnostic_t orig_diag_kind,
55 diagnostic_t diag_kind) const final override;
56
57private:
59 void *m_opts;
60};
61
62extern void
63handle_OPT_fdiagnostics_add_output_ (const gcc_options &opts,
65 const char *arg,
66 location_t loc);
67
68extern void
69handle_OPT_fdiagnostics_set_output_ (const gcc_options &opts,
71 const char *arg,
72 location_t loc);
73#endif
Definition opts-diagnostic.h:41
compiler_diagnostic_option_manager(const diagnostic_context &context, unsigned lang_mask, void *opts)
Definition opts-diagnostic.h:43
int option_enabled_p(diagnostic_option_id option_id) const final override
Definition opts-common.cc:1877
char * make_option_name(diagnostic_option_id option_id, diagnostic_t orig_diag_kind, diagnostic_t diag_kind) const final override
Definition opts.cc:3720
const diagnostic_context & m_context
Definition opts-diagnostic.h:58
void * m_opts
Definition opts-diagnostic.h:59
Definition diagnostic.h:506
Definition diagnostic.h:193
Definition opts-diagnostic.h:26
unsigned m_lang_mask
Definition opts-diagnostic.h:35
gcc_diagnostic_option_manager(unsigned lang_mask)
Definition opts-diagnostic.h:31
char * make_option_url(diagnostic_option_id option_id) const final override
Definition opts.cc:3797
diagnostic_t
Definition diagnostic-core.h:29
void handle_OPT_fdiagnostics_set_output_(const gcc_options &opts, diagnostic_context &dc, const char *arg, location_t loc)
Definition opts-diagnostic.cc:524
void handle_OPT_fdiagnostics_add_output_(const gcc_options &opts, diagnostic_context &dc, const char *arg, location_t loc)
Definition opts-diagnostic.cc:500
Definition diagnostic-core.h:72