summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@codesourcery.com>2000-08-22 06:54:54 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2000-08-22 06:54:54 +0000
commitb413d64dedee926fe22855d70647197ab0c7522c (patch)
tree58da251d2b0356355ede0569a531cdde142081d4 /gcc
parentc4a6c0f353b4e56359f0bfc8733ab390efa2416f (diff)
downloadgcc-b413d64dedee926fe22855d70647197ab0c7522c.tar.gz
diagnostic.h (report_problematic_module): Declare.
2000-08-22 Gabriel Dos Reis <gdr@codesourcery.com> * diagnostic.h (report_problematic_module): Declare. * diagnostic.c (report_problematic_module): New function. (report_error_function): Tweak. From-SVN: r35866
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/diagnostic.c48
-rw-r--r--gcc/diagnostic.h2
3 files changed, 35 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f78083dbcbb..817b50f1337 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2000-08-22 Gabriel Dos Reis <gdr@codesourcery.com>
+
+ * diagnostic.h (report_problematic_module): Declare.
+ * diagnostic.c (report_problematic_module): New function.
+ (report_error_function): Tweak.
+
Tue Aug 22 02:31:26 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stmt.c (expand_goto_internal, fixup_gotos): Only check
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 7124ecd58e3..35ca050c18f 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1243,26 +1243,7 @@ void
report_error_function (file)
const char *file ATTRIBUTE_UNUSED;
{
- struct file_stack *p;
-
- if (output_needs_newline (diagnostic_buffer))
- {
- verbatim ("\n");
- output_needs_newline (diagnostic_buffer) = 0;
- }
-
- if (input_file_stack && input_file_stack->next != 0
- && error_function_changed ())
- {
- for (p = input_file_stack->next; p; p = p->next)
- if (p == input_file_stack->next)
- verbatim ("In file included from %s:%d", p->name, p->line);
- else
- verbatim (",\n from %s:%d", p->name, p->line);
- verbatim (":\n");
- record_last_error_function ();
- }
-
+ report_problematic_module (diagnostic_buffer);
(*print_error_function) (input_filename);
}
@@ -1677,6 +1658,33 @@ set_diagnostic_context (dc, message, args_ptr, file, line, warn)
diagnostic_finalizer (dc) = lang_diagnostic_finalizer;
}
+void
+report_problematic_module (buffer)
+ output_buffer *buffer;
+{
+ struct file_stack *p;
+
+ if (output_needs_newline (buffer))
+ {
+ output_verbatim (buffer, "\n");
+ output_needs_newline (buffer) = 0;
+ }
+
+ if (input_file_stack && input_file_stack->next != 0
+ && error_function_changed ())
+ {
+ for (p = input_file_stack->next; p; p = p->next)
+ if (p == input_file_stack->next)
+ output_verbatim
+ (buffer, "In file included from %s:%d", p->name, p->line);
+ else
+ output_verbatim
+ (buffer, ",\n from %s:%d", p->name, p->line);
+ output_verbatim (buffer, ":\n");
+ record_last_error_function ();
+ }
+}
+
static void
default_diagnostic_starter (buffer, dc)
output_buffer *buffer;
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index e3450ce46ed..e93a77b3b12 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -195,6 +195,6 @@ int error_module_changed PARAMS ((void));
void record_last_error_module PARAMS ((void));
int error_function_changed PARAMS ((void));
void record_last_error_function PARAMS ((void));
-
+void report_problematic_module PARAMS ((output_buffer *));
#endif /* __GCC_DIAGNOSTIC_H__ */