OSDN Git Service

gcc/ada/
[pf3gnuchains/gcc-fork.git] / gcc / diagnostic.c
index 54c2da7..f323f36 100644 (file)
@@ -489,16 +489,16 @@ emit_diagnostic (diagnostic_t kind, location_t location, int opt,
   return report_diagnostic (&diagnostic);
 }
 
-/* An informative note.  Use this for additional details on an error
+/* An informative note at LOCATION.  Use this for additional details on an error
    message.  */
 void
-inform (const char *gmsgid, ...)
+inform (location_t location, const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
   va_start (ap, gmsgid);
-  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_NOTE);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_NOTE);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }
@@ -551,7 +551,7 @@ warning_at (location_t location, int opt, const char *gmsgid, ...)
    Returns true if the warning was printed, false if it was inhibited.  */
 
 bool
-pedwarn_at (location_t location, int opt, const char *gmsgid, ...)
+pedwarn (location_t location, int opt, const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
@@ -563,21 +563,6 @@ pedwarn_at (location_t location, int opt, const char *gmsgid, ...)
   return report_diagnostic (&diagnostic);
 }
 
-/* Equivalent to pedwarn_at using INPUT_LOCATION.  */
-
-bool
-pedwarn (int opt, const char *gmsgid, ...)
-{
-  diagnostic_info diagnostic;
-  va_list ap;
-
-  va_start (ap, gmsgid);
-  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_PEDWARN);
-  diagnostic.option_index = opt;
-  va_end (ap);
-  return report_diagnostic (&diagnostic);
-}
-
 /* A "permissive" error at LOCATION: issues an error unless
    -fpermissive was given on the command line, in which case it issues
    a warning.  Use this for things that really should be errors but we
@@ -586,7 +571,7 @@ pedwarn (int opt, const char *gmsgid, ...)
    Returns true if the warning was printed, false if it was inhibited.  */
 
 bool
-permerror_at (location_t location, const char *gmsgid, ...)
+permerror (location_t location, const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
@@ -599,33 +584,29 @@ permerror_at (location_t location, const char *gmsgid, ...)
   return report_diagnostic (&diagnostic);
 }
 
-/* Equivalent to permerror_at (input_location, ...).  */
-
-bool
-permerror (const char *gmsgid, ...)
+/* A hard error: the code is definitely ill-formed, and an object file
+   will not be produced.  */
+void
+error (const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
   va_start (ap, gmsgid);
-  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
-                      permissive_error_kind ());
-  diagnostic.option_index = OPT_fpermissive;
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ERROR);
+  report_diagnostic (&diagnostic);
   va_end (ap);
-  return report_diagnostic (&diagnostic);
 }
 
-
-/* A hard error: the code is definitely ill-formed, and an object file
-   will not be produced.  */
+/* Same as ebove, but use location LOC instead of input_location.  */
 void
-error (const char *gmsgid, ...)
+error_at (location_t loc, const char *gmsgid, ...)
 {
   diagnostic_info diagnostic;
   va_list ap;
 
   va_start (ap, gmsgid);
-  diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, DK_ERROR);
+  diagnostic_set_info (&diagnostic, gmsgid, &ap, loc, DK_ERROR);
   report_diagnostic (&diagnostic);
   va_end (ap);
 }