]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostic.h (struct diagnostic_context): Add new member internal_error.
authorGabriel Dos Reis <gdr@codesourcery.com>
Sun, 2 Jun 2002 19:06:30 +0000 (19:06 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sun, 2 Jun 2002 19:06:30 +0000 (19:06 +0000)
* diagnostic.h (struct diagnostic_context):  Add new member
internal_error.
(internal_error_function): Remove declaration.
* diagnostic.c (internal_error_function): Remove definition..
(internal_error): Adjust use.
ada/
* misc.c (gnat_init): Adjust setting of internal_error_function.

From-SVN: r54179

gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/misc.c
gcc/diagnostic.c
gcc/diagnostic.h

index 1bf04eb060aefb00ce1890b459148d01f030cfc9..dc8a45dd7c8327e96e417dccf2fb8ae2756f58a1 100644 (file)
@@ -1,3 +1,11 @@
+2002-06-02  Gabriel Dos Reis  <gdr@codesourcery.com>
+
+       * diagnostic.h (struct diagnostic_context):  Add new member
+       internal_error. 
+       (internal_error_function): Remove declaration.
+       * diagnostic.c (internal_error_function): Remove definition..
+       (internal_error): Adjust use.
+
 2002-06-02  Richard Henderson  <rth@redhat.com>
 
        * rtl.h (CC0_P): New.
index b4b6161fbe362fe05fef27a57f798e715195d3ac..a17ab0357985ebea87d4dd9fe6d2225f28a7eb7a 100644 (file)
@@ -1,3 +1,7 @@
+2002-06-02  Gabriel Dos Reis  <gdr@codesourcery.com>
+
+       * misc.c (gnat_init): Adjust setting of internal_error_function.
+
 2002-06-01  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * gnat_ug.texi: Use @ifnottex instead of @ifinfo.
index 63ac00a0e875b278b4c29cb5abcdeec4bbedeea0..3bc01d303aae16ee54db23e1ca0a2b073c63babc 100644 (file)
@@ -384,7 +384,7 @@ gnat_init (filename)
   gnat_argc++;
   gnat_argv[gnat_argc] = 0;
 
-  set_internal_error_function (internal_error_function);
+  global_dc->internal_error = &internal_error_function;
 
   /* Show that REFERENCE_TYPEs are internal and should be Pmode.  */
   internal_reference_types ();
index 027ea53016b56e7e9bb55e0aa3129bb611b81a84..f276ec0dd1ddc72d1641e542c669af082c5293d9 100644 (file)
@@ -1236,20 +1236,6 @@ fatal_error VPARAMS ((const char *msgid, ...))
   exit (FATAL_EXIT_CODE);
 }
 
-/* Report a compiler error at the current line number.  Allow a front end to
-   intercept the message.  */
-
-static void (*internal_error_function) PARAMS ((const char *, va_list *));
-
-/* Set the function to call when a compiler error occurs.  */
-
-void
-set_internal_error_function (f)
-     void (*f) PARAMS ((const char *, va_list *));
-{
-  internal_error_function = f;
-}
-
 void
 internal_error VPARAMS ((const char *msgid, ...))
 {
@@ -1270,8 +1256,8 @@ internal_error VPARAMS ((const char *msgid, ...))
     }
 #endif
 
-  if (internal_error_function != 0)
-    (*internal_error_function) (_(msgid), &ap);
+  if (global_dc->internal_error != 0)
+    (*global_dc->internal_error) (_(msgid), &ap);
 
   set_diagnostic_context
     (&dc, msgid, &ap, input_filename, lineno, /* warn = */0);
index 925134af48f9d5e36c0dd4a0cc476215ca73c461..3762136d0b62f233f9e019003a00a31dd3a38c22 100644 (file)
@@ -203,6 +203,9 @@ struct diagnostic_context
   /* This function is called after the diagnostic message is printed.  */
   void (*end_diagnostic) PARAMS ((output_buffer *, diagnostic_context *));
 
+  /* Client hook to report an internal error.  */
+  void (*internal_error) PARAMS ((const char *, va_list *));
+
   /* Hook for front-end extensions.  */
   void *x_data;
 };
@@ -275,9 +278,6 @@ extern diagnostic_context *global_dc;
 extern void set_diagnostic_context     PARAMS ((diagnostic_context *,
                                                 const char *, va_list *,
                                                 const char *, int, int));
-extern void set_internal_error_function        PARAMS ((void (*)
-                                                PARAMS ((const char *,
-                                                         va_list *))));
 extern void report_diagnostic          PARAMS ((diagnostic_context *));
 extern void diagnostic_initialize      PARAMS ((diagnostic_context *));
 extern void init_output_buffer         PARAMS ((output_buffer *,