opts-common.c (handle_option, [...]): Add diagnostic_context parameter.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 5 Oct 2010 14:28:39 +0000 (15:28 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 5 Oct 2010 14:28:39 +0000 (15:28 +0100)
* opts-common.c (handle_option, handle_generated_option,
read_cmdline_option, set_option): Add diagnostic_context
parameter.  Update calls among these functions.
(set_option): Don't use global_dc.
* opts.c (read_cmdline_options): Pass global_dc to
read_cmdline_option.
(decode_options): Pass global_dc to enable_warning_as_error.
(common_handle_option): Pass global_dc to enable_warning_as_error.
(enable_warning_as_error): Add diagnostic_context parameter.
Document parameters.  Don't use global_dc.  Pass
diagnostic_context parameter to handle_generated_option.
* opts.h (set_option, handle_option, handle_generated_option,
read_cmdline_option, enable_warning_as_error): Add
diagnostic_context parameter.
* Makefile.in (lto-opts.o): Update dependencies.
* coretypes.h (struct diagnostic_context, diagnostic_context):
Declare here.
* diagnostic.h (diagnostic_context): Don't declare typedef here.
* gcc.c (process_command): Pass global_dc to read_cmdline_option.
* langhooks-def.h (struct diagnostic_context): Don't declare here.
(lhd_print_error_function, lhd_initialize_diagnostics): Declare
using diagnostic_context typedef.
* langhooks.c (lhd_initialize_diagnostics): Declare using
diagnostic_context typedef.
* langhooks.h (struct diagnostic_context): Don't declare here.
(initialize_diagnostics, print_error_function): Declare using
diagnostic_context typedef.
* lto-opts.c: Include diagnostic.h.
(lto_reissue_options): Pass global_dc to set_option.  Pass
DK_UNSPECIFIED not 0.
* plugin.c (plugins_internal_error_function): Declare using
diagnostic_context typedef.
* plugin.h (struct diagnostic_context): Don't declare here.
(plugins_internal_error_function): Declare using
diagnostic_context typedef.

c-family:
* c-common.h (struct diagnostic_context): Don't declare here.
(c_common_initialize_diagnostics): Declare using
diagnostic_context typedef.
* c-opts.c (c_common_handle_option): Pass global_dc to
handle_generated_option.

cp:
* cp-tree.h (cxx_print_error_function,
cxx_initialize_diagnostics): Declare using diagnostic_context
typedef.

From-SVN: r164991

19 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/c-family/ChangeLog
gcc/c-family/c-common.h
gcc/c-family/c-opts.c
gcc/coretypes.h
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/diagnostic.h
gcc/gcc.c
gcc/langhooks-def.h
gcc/langhooks.c
gcc/langhooks.h
gcc/lto-opts.c
gcc/opts-common.c
gcc/opts.c
gcc/opts.h
gcc/plugin.c
gcc/plugin.h

index cef1cd0c6f62c3abe717f71977d4a3df82a49309..c5f5c4799b5c5adc8e3ee48ae89fcd7384f5d2e7 100644 (file)
@@ -1,3 +1,41 @@
+2010-10-05  Joseph Myers  <joseph@codesourcery.com>
+
+       * opts-common.c (handle_option, handle_generated_option,
+       read_cmdline_option, set_option): Add diagnostic_context
+       parameter.  Update calls among these functions.
+       (set_option): Don't use global_dc.
+       * opts.c (read_cmdline_options): Pass global_dc to
+       read_cmdline_option.
+       (decode_options): Pass global_dc to enable_warning_as_error.
+       (common_handle_option): Pass global_dc to enable_warning_as_error.
+       (enable_warning_as_error): Add diagnostic_context parameter.
+       Document parameters.  Don't use global_dc.  Pass
+       diagnostic_context parameter to handle_generated_option.
+       * opts.h (set_option, handle_option, handle_generated_option,
+       read_cmdline_option, enable_warning_as_error): Add
+       diagnostic_context parameter.
+       * Makefile.in (lto-opts.o): Update dependencies.
+       * coretypes.h (struct diagnostic_context, diagnostic_context):
+       Declare here.
+       * diagnostic.h (diagnostic_context): Don't declare typedef here.
+       * gcc.c (process_command): Pass global_dc to read_cmdline_option.
+       * langhooks-def.h (struct diagnostic_context): Don't declare here.
+       (lhd_print_error_function, lhd_initialize_diagnostics): Declare
+       using diagnostic_context typedef.
+       * langhooks.c (lhd_initialize_diagnostics): Declare using
+       diagnostic_context typedef.
+       * langhooks.h (struct diagnostic_context): Don't declare here.
+       (initialize_diagnostics, print_error_function): Declare using
+       diagnostic_context typedef.
+       * lto-opts.c: Include diagnostic.h.
+       (lto_reissue_options): Pass global_dc to set_option.  Pass
+       DK_UNSPECIFIED not 0.
+       * plugin.c (plugins_internal_error_function): Declare using
+       diagnostic_context typedef.
+       * plugin.h (struct diagnostic_context): Don't declare here.
+       (plugins_internal_error_function): Declare using
+       diagnostic_context typedef.
+
 2010-10-05  Olivier Hainque  <hainque@adacore.com>
             Nicolas Roche  <roche@adacore.com>
 
index c25afb5fa1b967e91d450164d29b55e78a1488ae..04670344a0a491e6b59b3ce3bdce7e55d8156ba7 100644 (file)
@@ -2325,7 +2325,7 @@ lto-symtab.o: lto-symtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    $(LTO_STREAMER_H) $(LINKER_PLUGIN_API_H) gt-lto-symtab.h
 lto-opts.o: lto-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
    $(HASHTAB_H) $(GGC_H) $(BITMAP_H) $(FLAGS_H) opts.h options.h \
-   $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H) $(LTO_STREAMER_H)
+   $(TARGET_H) $(TOPLEV_H) $(DIAGNOSTIC_H) $(LTO_STREAMER_H)
 lto-streamer.o: lto-streamer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h   \
    $(TM_H) $(TREE_H) $(GIMPLE_H) $(BITMAP_H) $(LTO_STREAMER_H) $(FLAGS_H) \
    $(TREE_FLOW_H) $(DIAGNOSTIC_CORE_H) $(LTO_SYMTAB_H) $(TOPLEV_H) $(DIAGNOSTIC_CORE_H)
index fa2e375ce1b7d98c247748de4b88088ea3e24978..efe6b54a984a17021063ea33b41da6d8ef04602b 100644 (file)
@@ -1,3 +1,11 @@
+2010-10-05  Joseph Myers  <joseph@codesourcery.com>
+
+       * c-common.h (struct diagnostic_context): Don't declare here.
+       (c_common_initialize_diagnostics): Declare using
+       diagnostic_context typedef.
+       * c-opts.c (c_common_handle_option): Pass global_dc to
+       handle_generated_option.
+
 2010-10-04  Joseph Myers  <joseph@codesourcery.com>
 
        * c-opts.c (c_common_handle_option): Pass &global_options_set to
index 08ef3b750faf39c48bf8232dca234e4554a383f4..f8d7ff5291420cc4727f9a1369ff4b18c2341cbd 100644 (file)
@@ -740,10 +740,8 @@ extern void set_compound_literal_name (tree decl);
 
 extern tree build_va_arg (location_t, tree, tree);
 
-struct diagnostic_context;
-
 extern unsigned int c_common_option_lang_mask (void);
-extern void c_common_initialize_diagnostics (struct diagnostic_context *);
+extern void c_common_initialize_diagnostics (diagnostic_context *);
 extern bool c_common_complain_wrong_lang_p (const struct cl_option *);
 extern void c_common_init_options (unsigned int, struct cl_decoded_option *);
 extern bool c_common_post_options (const char **);
index 87d975f4b49cf0db97045934afae5f00feb134d2..b7bf295f80cc4195dd88e08f060665c64b789703 100644 (file)
@@ -438,7 +438,7 @@ c_common_handle_option (size_t scode, const char *arg, int value,
       set_Wformat (value);
       handle_generated_option (&global_options, &global_options_set,
                               OPT_Wimplicit, NULL, value,
-                              c_family_lang_mask, kind, handlers);
+                              c_family_lang_mask, kind, handlers, global_dc);
       warn_char_subscripts = value;
       warn_missing_braces = value;
       warn_parentheses = value;
@@ -533,11 +533,13 @@ c_common_handle_option (size_t scode, const char *arg, int value,
       if (warn_implicit_int == -1)
        handle_generated_option (&global_options, &global_options_set,
                                 OPT_Wimplicit_int, NULL, value,
-                                c_family_lang_mask, kind, handlers);
+                                c_family_lang_mask, kind, handlers,
+                                global_dc);
       if (warn_implicit_function_declaration == -1)
        handle_generated_option (&global_options, &global_options_set,
                                 OPT_Wimplicit_function_declaration, NULL,
-                                value, c_family_lang_mask, kind, handlers);
+                                value, c_family_lang_mask, kind, handlers,
+                                global_dc);
       break;
 
     case OPT_Winvalid_pch:
index 4fc5ceacbb571717645f5a9b17494e22117faf17..419142a733f6eb83c7f963ff6253fad4ab4b10d2 100644 (file)
@@ -70,6 +70,8 @@ struct cl_optimization;
 struct cl_option;
 struct cl_decoded_option;
 struct cl_option_handlers;
+struct diagnostic_context;
+typedef struct diagnostic_context diagnostic_context;
 struct gimple_seq_d;
 typedef struct gimple_seq_d *gimple_seq;
 typedef const struct gimple_seq_d *const_gimple_seq;
index cd9d533e1fd5e85ddc2dfb9b0bbfff2f6d216fdd..7f77a7b56a3c6162b35f833837eebc98f4e1158f 100644 (file)
@@ -1,3 +1,9 @@
+2010-10-05  Joseph Myers  <joseph@codesourcery.com>
+
+       * cp-tree.h (cxx_print_error_function,
+       cxx_initialize_diagnostics): Declare using diagnostic_context
+       typedef.
+
 2010-10-04  Andi Kleen <ak@linux.intel.com>
 
        * Make-lang.in (g++, cc1plus): Add + to build rule.
index fa625701f0e17b775e00ac64c68909d7361a9367..e4f24126dcaa92b2160e8ee49167b82fe1c17e6e 100644 (file)
@@ -5430,7 +5430,7 @@ extern void cxx_print_xnode                       (FILE *, tree, int);
 extern void cxx_print_decl                     (FILE *, tree, int);
 extern void cxx_print_type                     (FILE *, tree, int);
 extern void cxx_print_identifier               (FILE *, tree, int);
-extern void cxx_print_error_function   (struct diagnostic_context *,
+extern void cxx_print_error_function           (diagnostic_context *,
                                                 const char *,
                                                 struct diagnostic_info *);
 
@@ -5594,7 +5594,7 @@ extern alias_set_type cxx_get_alias_set           (tree);
 extern bool cxx_warn_unused_global_decl                (const_tree);
 extern size_t cp_tree_size                     (enum tree_code);
 extern bool cp_var_mod_type_p                  (tree, tree);
-extern void cxx_initialize_diagnostics         (struct diagnostic_context *);
+extern void cxx_initialize_diagnostics         (diagnostic_context *);
 extern int cxx_types_compatible_p              (tree, tree);
 extern void init_shadowed_var_for_decl         (void);
 
index 460fb8fa8c3ed841d56a921bd062d7151cf86823..99671c64e59b199c0b5100164f8e311b8d14d222 100644 (file)
@@ -52,7 +52,6 @@ typedef struct diagnostic_classification_change_t
 } diagnostic_classification_change_t;
 
 /*  Forward declarations.  */
-typedef struct diagnostic_context diagnostic_context;
 typedef void (*diagnostic_starter_fn) (diagnostic_context *,
                                       diagnostic_info *);
 typedef diagnostic_starter_fn diagnostic_finalizer_fn;
index 82ddc1620d28c281ffc0c985bcb075e7f05fdfd4..f6e0b9ec22f436ed091d7aa0cdd8f29abffad21d 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3806,7 +3806,8 @@ process_command (unsigned int decoded_options_count,
        }
 
       read_cmdline_option (&global_options, &global_options_set,
-                          decoded_options + j, CL_DRIVER, &handlers);
+                          decoded_options + j, CL_DRIVER, &handlers,
+                          global_dc);
     }
 
   /* If -save-temps=obj and -o name, create the prefix to use for %b.
index a4dda6b7bed885109ebbf926c03546f601ee72d7..fa18eed9fb7fcf1041a3b4b3c0732917198d4a42 100644 (file)
@@ -24,7 +24,6 @@ along with GCC; see the file COPYING3.  If not see
 
 #include "hooks.h"
 
-struct diagnostic_context;
 struct diagnostic_info;
 
 /* Note to creators of new hooks:
@@ -51,7 +50,7 @@ extern void lhd_print_tree_nothing (FILE *, tree, int);
 extern const char *lhd_decl_printable_name (tree, int);
 extern const char *lhd_dwarf_name (tree, int);
 extern int lhd_types_compatible_p (tree, tree);
-extern void lhd_print_error_function (struct diagnostic_context *,
+extern void lhd_print_error_function (diagnostic_context *,
                                      const char *, struct diagnostic_info *);
 extern void lhd_set_decl_assembler_name (tree);
 extern bool lhd_warn_unused_global_decl (const_tree);
@@ -65,7 +64,7 @@ extern tree lhd_expr_to_decl (tree, bool *, bool *);
 extern tree lhd_builtin_function (tree);
 
 /* Declarations of default tree inlining hooks.  */
-extern void lhd_initialize_diagnostics (struct diagnostic_context *);
+extern void lhd_initialize_diagnostics (diagnostic_context *);
 extern void lhd_init_options (unsigned int,
                              struct cl_decoded_option *);
 extern bool lhd_complain_wrong_lang_p (const struct cl_option *);
index ce7522b1585bb0aa88ffd58f7536c43f3685fe6c..76c066bfaa3793ec1044e7ce50fadc3353e32c44 100644 (file)
@@ -333,7 +333,7 @@ write_global_declarations (void)
 
 /* Called to perform language-specific initialization of CTX.  */
 void
-lhd_initialize_diagnostics (struct diagnostic_context *ctx ATTRIBUTE_UNUSED)
+lhd_initialize_diagnostics (diagnostic_context *ctx ATTRIBUTE_UNUSED)
 {
 }
 
index eb8b8fcfbd4257565ddfc4df44c2c4ff83919a64..0c8a982c67391d09da08a2cbea57c5123807273c 100644 (file)
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 
 /* This file should be #include-d after tree.h.  */
 
-struct diagnostic_context;
 struct diagnostic_info;
 
 struct gimplify_omp_ctx;
@@ -275,7 +274,7 @@ struct lang_hooks
 
   /* Callback used to perform language-specific initialization for the
      global diagnostic context structure.  */
-  void (*initialize_diagnostics) (struct diagnostic_context *);
+  void (*initialize_diagnostics) (diagnostic_context *);
 
   /* Return true if a warning should be given about option OPTION,
      which is for the wrong language, false if it should be quietly
@@ -374,7 +373,7 @@ struct lang_hooks
   int (*types_compatible_p) (tree x, tree y);
 
   /* Called by report_error_function to print out function name.  */
-  void (*print_error_function) (struct diagnostic_context *, const char *,
+  void (*print_error_function) (diagnostic_context *, const char *,
                                struct diagnostic_info *);
 
   /* Convert a character from the host's to the target's character
index f3c5d67382392484e7fa281e7906c081b5ddc085..66010c68adf4f2b42599234e3f7cff7254dca5e3 100644 (file)
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "opts.h"
 #include "options.h"
 #include "target.h"
-#include "diagnostic-core.h"
+#include "diagnostic.h"
 #include "toplev.h"
 #include "lto-streamer.h"
 
@@ -404,7 +404,7 @@ lto_reissue_options (void)
       if (flag_var)
        set_option (&global_options, &global_options_set,
                    o->code, o->value, o->arg,
-                   0 /*DK_UNSPECIFIED*/);
+                   DK_UNSPECIFIED, global_dc);
 
       if (o->type == CL_TARGET)
        targetm.handle_option (o->code, o->arg, o->value);
index 5ac4fabaec1800966a45b91c4f83827048bb2617..a5f66ce45faafad821f5c7b6fe6e64143b3ab024 100644 (file)
@@ -804,7 +804,8 @@ keep:
    option, DK_UNSPECIFIED otherwise.  GENERATED_P is true for an
    option generated as part of processing another option or otherwise
    generated internally, false for one explicitly passed by the user.
-   Returns false if the switch was invalid.  */
+   Returns false if the switch was invalid.  DC is the diagnostic
+   context for options affecting diagnostics state, or NULL.  */
 
 bool
 handle_option (struct gcc_options *opts,
@@ -812,7 +813,7 @@ handle_option (struct gcc_options *opts,
               const struct cl_decoded_option *decoded,
               unsigned int lang_mask, int kind,
               const struct cl_option_handlers *handlers,
-              bool generated_p)
+              bool generated_p, diagnostic_context *dc)
 {
   size_t opt_index = decoded->opt_index;
   const char *arg = decoded->arg;
@@ -823,7 +824,7 @@ handle_option (struct gcc_options *opts,
 
   if (flag_var)
     set_option (opts, (generated_p ? NULL : opts_set),
-               opt_index, value, arg, kind);
+               opt_index, value, arg, kind, dc);
 
   for (i = 0; i < handlers->num_handlers; i++)
     if (option->flags & handlers->handlers[i].mask)
@@ -849,13 +850,14 @@ handle_generated_option (struct gcc_options *opts,
                         struct gcc_options *opts_set,
                         size_t opt_index, const char *arg, int value,
                         unsigned int lang_mask, int kind,
-                        const struct cl_option_handlers *handlers)
+                        const struct cl_option_handlers *handlers,
+                        diagnostic_context *dc)
 {
   struct cl_decoded_option decoded;
 
   generate_option (opt_index, arg, value, lang_mask, &decoded);
   return handle_option (opts, opts_set, &decoded, lang_mask, kind, handlers,
-                       true);
+                       true, dc);
 }
 
 /* Fill in *DECODED with an option described by OPT_INDEX, ARG and
@@ -915,14 +917,16 @@ generate_option_input_file (const char *file,
 
 /* Handle the switch DECODED for the language indicated by LANG_MASK,
    using the handlers in *HANDLERS and setting fields in OPTS and
-   OPTS_SET.  */
+   OPTS_SET and using diagnostic context DC (if not NULL) for
+   diagnostic options.  */
 
 void
 read_cmdline_option (struct gcc_options *opts,
                     struct gcc_options *opts_set,
                     struct cl_decoded_option *decoded,
                     unsigned int lang_mask,
-                    const struct cl_option_handlers *handlers)
+                    const struct cl_option_handlers *handlers,
+                    diagnostic_context *dc)
 {
   const struct cl_option *option;
   const char *opt = decoded->orig_option_with_args_text;
@@ -974,16 +978,19 @@ read_cmdline_option (struct gcc_options *opts,
   gcc_assert (!decoded->errors);
 
   if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED,
-                     handlers, false))
+                     handlers, false, dc))
     error ("unrecognized command line option %qs", opt);
 }
 
 /* Set any field in OPTS, and OPTS_SET if not NULL, for option
-   OPT_INDEX according to VALUE and ARG, diagnostic kind KIND.  */
+   OPT_INDEX according to VALUE and ARG, diagnostic kind KIND, using
+   diagnostic context DC if not NULL for diagnostic
+   classification.  */
 
 void
 set_option (struct gcc_options *opts, struct gcc_options *opts_set,
-           int opt_index, int value, const char *arg, int kind)
+           int opt_index, int value, const char *arg, int kind,
+           diagnostic_context *dc)
 {
   const struct cl_option *option = &cl_options[opt_index];
   void *flag_var = option_flag_var (opt_index, opts);
@@ -1028,8 +1035,9 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set,
        break;
     }
 
-  if ((diagnostic_t) kind != DK_UNSPECIFIED)
-    diagnostic_classify_diagnostic (global_dc, opt_index, (diagnostic_t) kind,
+  if ((diagnostic_t) kind != DK_UNSPECIFIED
+      && dc != NULL)
+    diagnostic_classify_diagnostic (dc, opt_index, (diagnostic_t) kind,
                                    UNKNOWN_LOCATION);
 }
 
index 6799f9bd3857e8243b5e34de396438a115bf4df3..056033581700160839357f99760e2bd6c3ccefd2 100644 (file)
@@ -639,7 +639,8 @@ read_cmdline_options (struct cl_decoded_option *decoded_options,
        }
 
       read_cmdline_option (&global_options, &global_options_set,
-                          decoded_options + i, lang_mask, handlers);
+                          decoded_options + i, lang_mask, handlers,
+                          global_dc);
     }
 }
 
@@ -879,7 +880,8 @@ decode_options (unsigned int argc, const char **argv,
     }
 
   /* Enable -Werror=coverage-mismatch by default */
-  enable_warning_as_error ("coverage-mismatch", 1, lang_mask, &handlers);
+  enable_warning_as_error ("coverage-mismatch", 1, lang_mask, &handlers,
+                          global_dc);
 
   if (first_time_p)
     {
@@ -1606,7 +1608,7 @@ common_handle_option (struct gcc_options *opts,
       break;
 
     case OPT_Werror_:
-      enable_warning_as_error (arg, value, lang_mask, handlers);
+      enable_warning_as_error (arg, value, lang_mask, handlers, global_dc);
       break;
 
     case OPT_Wlarger_than_:
@@ -2284,12 +2286,15 @@ register_warning_as_error_callback (void (*callback) (int))
   warning_as_error_callback = callback;
 }
 
-/* Enable a warning option as an error.  This is used by -Werror= and
-   also by legacy Werror-implicit-function-declaration.  */
+/* Enable (or disable if VALUE is 0) a warning option ARG (language
+   mask LANG_MASK, option handlers HANDLERS) as an error for
+   diagnostic context DC (possibly NULL).  This is used by
+   -Werror=.  */
 
 void
 enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
-                        const struct cl_option_handlers *handlers)
+                        const struct cl_option_handlers *handlers,
+                        diagnostic_context *dc)
 {
   char *new_option;
   int option_index;
@@ -2311,8 +2316,9 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
        option_index = option->alias_target;
       if (option_index == OPT_SPECIAL_ignore)
        return;
-      diagnostic_classify_diagnostic (global_dc, option_index, kind,
-                                     UNKNOWN_LOCATION);
+      if (dc)
+       diagnostic_classify_diagnostic (dc, option_index, kind,
+                                       UNKNOWN_LOCATION);
       if (kind == DK_ERROR)
        {
          const struct cl_option * const option = cl_options + option_index;
@@ -2321,7 +2327,8 @@ enable_warning_as_error (const char *arg, int value, unsigned int lang_mask,
          if (option->var_type == CLVC_BOOLEAN)
            handle_generated_option (&global_options, &global_options_set,
                                     option_index, NULL, value, lang_mask,
-                                    (int)kind, handlers);
+                                    (int)kind, handlers,
+                                    dc);
 
          if (warning_as_error_callback)
            warning_as_error_callback (option_index);
index 2dbccbc79fe4899145dc53d6e56bfb6e362dce10..fbfe6bf34479c9f548ed1b509809a901023f1434 100644 (file)
@@ -216,19 +216,21 @@ extern bool get_option_state (struct gcc_options *, int,
                              struct cl_option_state *);
 extern void set_option (struct gcc_options *opts,
                        struct gcc_options *opts_set,
-                       int opt_index, int value, const char *arg, int);
+                       int opt_index, int value, const char *arg, int kind,
+                       diagnostic_context *dc);
 extern void *option_flag_var (int opt_index, struct gcc_options *opts);
 bool handle_option (struct gcc_options *opts,
                    struct gcc_options *opts_set,
                    const struct cl_decoded_option *decoded,
                    unsigned int lang_mask, int kind,
                    const struct cl_option_handlers *handlers,
-                   bool generated_p);
+                   bool generated_p, diagnostic_context *dc);
 bool handle_generated_option (struct gcc_options *opts,
                              struct gcc_options *opts_set,
                              size_t opt_index, const char *arg, int value,
                              unsigned int lang_mask, int kind,
-                             const struct cl_option_handlers *handlers);
+                             const struct cl_option_handlers *handlers,
+                             diagnostic_context *dc);
 void generate_option (size_t opt_index, const char *arg, int value,
                      unsigned int lang_mask,
                      struct cl_decoded_option *decoded);
@@ -238,10 +240,12 @@ extern void read_cmdline_option (struct gcc_options *opts,
                                 struct gcc_options *opts_set,
                                 struct cl_decoded_option *decoded,
                                 unsigned int lang_mask,
-                                const struct cl_option_handlers *handlers);
+                                const struct cl_option_handlers *handlers,
+                                diagnostic_context *dc);
 extern void register_warning_as_error_callback (void (*callback) (int));
 extern void enable_warning_as_error (const char *arg, int value,
                                     unsigned int lang_mask,
-                                    const struct cl_option_handlers *handlers);
+                                    const struct cl_option_handlers *handlers,
+                                    diagnostic_context *dc);
 extern void print_ignored_options (void);
 #endif
index e7c4cf689fe7c01437bb68b805e6c47786dddfa7..bfcff3e9cde604286492c757f4e6ccb799b9d4a1 100644 (file)
@@ -830,7 +830,7 @@ warn_if_plugins (void)
 /* Likewise, as a callback from the diagnostics code.  */
 
 void
-plugins_internal_error_function (struct diagnostic_context *context ATTRIBUTE_UNUSED,
+plugins_internal_error_function (diagnostic_context *context ATTRIBUTE_UNUSED,
                                 const char *msgid ATTRIBUTE_UNUSED,
                                 va_list *ap ATTRIBUTE_UNUSED)
 {
index ec0420346f426492b3132f578d6c516ee34ecb66..4d2d12a9da61090ea811afa43289a61956b7d188 100644 (file)
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "gcc-plugin.h"
 
 struct attribute_spec;
-struct diagnostic_context;
 
 extern void add_new_plugin (const char *);
 extern void parse_plugin_arg_opt (const char *);
@@ -33,7 +32,7 @@ extern bool plugins_active_p (void);
 extern void dump_active_plugins (FILE *);
 extern void debug_active_plugins (void);
 extern void warn_if_plugins (void);
-extern void plugins_internal_error_function (struct diagnostic_context *,
+extern void plugins_internal_error_function (diagnostic_context *,
                                             const char *, va_list *);
 extern void print_plugins_versions (FILE *file, const char *indent);
 extern void print_plugins_help (FILE *file, const char *indent);