Commit 47b69537 by Gabriel Dos Reis Committed by Gabriel Dos Reis

toplev.h (report_error_function): Remove.

	* toplev.h (report_error_function): Remove.

	* diagnostic.h (location_t): New datatype.
	(text_info): Likewise.
	(diagnostic_info): Likewise.
	(output_prefix): New macro.
	(diagnostic_last_function_changed): Likewise.
	(diagnostic_set_last_function): Likewise.
	(diagnostic_last_module_changed): Likewise.
	(diagnostic_set_last_module): Likewise.
	(report_diagnostic): Now macro.
	(diagnostic_set_info): Declare.

	* diagnostic.c (report_problematic_module): Rename to
	diagnostic_repor_current_module.
	(set_diagnostic_context): Remove.
	(count_error): Rename to diagnostic_error_count.
	(error_function_changed): Remove.
	(record_last_error_function): Likewise.
	(error_module_changed): Likewise.
	(record_last_error_module): Likewise.
	(context_as_prefix): Rename to diagnostic_build_prefix.
	(flush_diagnostic_buffer): Rename to diagnostic_flush_buffer.
	(diagnostic_set_info): New function.

	* objc/objc-act.c: #include diagnostic.h
	(error_with_ivar): Adjust call to count_error.
	(warn_with_method): Likewise.
	* objc/Make-lang.in (objc-act.o): Depend on diagnostic.h

cp/
2002-06-04  Gabriel Dos Reis  <gdr@codesourcery.com>

	* error.c (cp_diagnostic_starter): Adjust call.
	(maybe_print_instantiation_context): Change prototype to take a
	'diagnostic_info *'.
	(print_instantiation_full_context): Likewise.
	(print_instantiation_partial_context): Likewise.
	(cp_diagnostic_starter): Likewise.
	(cp_diagnostic_finalizer): Likewise.
	(cp_print_error_function): Likewise.
	(cp_printer): Take a secondary parameter as a 'text_info *'.
	Remove output_state savings.  Adjust calls.

f/
2002-06-04  Gabriel Dos Reis  <gdr@codesourcery.com>

	* bad.c (ffebad_start_): Adjust call to count_error.
	* Make-lang.in (f/bad.o): Depend on diagnostic.h
	* bad.c: #include diagnostic.h

From-SVN: r54291
parent 304a3a85
2002-06-05 Gabriel Dos Reis <gdr@codesourcery.com>
* toplev.h (report_error_function): Remove.
* diagnostic.h (location_t): New datatype.
(text_info): Likewise.
(diagnostic_info): Likewise.
(output_prefix): New macro.
(diagnostic_last_function_changed): Likewise.
(diagnostic_set_last_function): Likewise.
(diagnostic_last_module_changed): Likewise.
(diagnostic_set_last_module): Likewise.
(report_diagnostic): Now macro.
(diagnostic_set_info): Declare.
* diagnostic.c (report_problematic_module): Rename to
diagnostic_repor_current_module.
(set_diagnostic_context): Remove.
(count_error): Rename to diagnostic_error_count.
(error_function_changed): Remove.
(record_last_error_function): Likewise.
(error_module_changed): Likewise.
(record_last_error_module): Likewise.
(context_as_prefix): Rename to diagnostic_build_prefix.
(flush_diagnostic_buffer): Rename to diagnostic_flush_buffer.
(diagnostic_set_info): New function.
* objc/objc-act.c: #include diagnostic.h
(error_with_ivar): Adjust call to count_error.
(warn_with_method): Likewise.
* objc/Make-lang.in (objc-act.o): Depend on diagnostic.h
2002-06-05 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.c (xtensa_build_va_list): Use
......
......@@ -32,13 +32,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
void
pedwarn_c99 VPARAMS ((const char *msgid, ...))
{
diagnostic_context dc;
diagnostic_info diagnostic;
VA_OPEN (ap, msgid);
VA_FIXEDARG (ap, const char *, msgid);
set_diagnostic_context (&dc, msgid, &ap, input_filename, lineno,
!flag_isoc99 || !flag_pedantic_errors);
report_diagnostic (&dc);
diagnostic_set_info (&diagnostic, msgid, &ap, input_filename, lineno,
flag_isoc99 ? pedantic_error_kind () : DK_WARNING);
report_diagnostic (&diagnostic);
VA_CLOSE (ap);
}
......@@ -1025,7 +1025,7 @@ check_function_format (status, attrs, params)
static void
status_warning VPARAMS ((int *status, const char *msgid, ...))
{
diagnostic_context dc;
diagnostic_info diagnostic ;
VA_OPEN (ap, msgid);
VA_FIXEDARG (ap, int *, status);
......@@ -1036,9 +1036,9 @@ status_warning VPARAMS ((int *status, const char *msgid, ...))
else
{
/* This duplicates the warning function behavior. */
set_diagnostic_context
(&dc, msgid, &ap, input_filename, lineno, /* warn = */ 1);
report_diagnostic (&dc);
diagnostic_set_info (&diagnostic, _(msgid), &ap, input_filename, lineno,
DK_WARNING);
report_diagnostic (&diagnostic);
}
VA_CLOSE (ap);
......
......@@ -35,7 +35,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "langhooks.h"
static int c_tree_printer PARAMS ((output_buffer *));
static bool c_tree_printer PARAMS ((output_buffer *, text_info *));
static tree inline_forbidden_p PARAMS ((tree *, int *, void *));
static void expand_deferred_fns PARAMS ((void));
static tree start_cdtor PARAMS ((int));
......@@ -389,13 +389,14 @@ c_objc_common_finish_file ()
by the C++ front-end.
Please notice when called, the `%' part was already skipped by the
diagnostic machinery. */
static int
c_tree_printer (buffer)
static bool
c_tree_printer (buffer, text)
output_buffer *buffer;
text_info *text;
{
tree t = va_arg (output_buffer_format_args (buffer), tree);
tree t = va_arg (*text->args_ptr, tree);
switch (*output_buffer_text_cursor (buffer))
switch (*text->format_spec)
{
case 'D':
case 'F':
......@@ -406,10 +407,10 @@ c_tree_printer (buffer)
: "({anonymous})";
output_add_string (buffer, n);
}
return 1;
return true;
default:
return 0;
return false;
}
}
......
2002-06-04 Gabriel Dos Reis <gdr@codesourcery.com>
* error.c (cp_diagnostic_starter): Adjust call.
(maybe_print_instantiation_context): Change prototype to take a
'diagnostic_info *'.
(print_instantiation_full_context): Likewise.
(print_instantiation_partial_context): Likewise.
(cp_diagnostic_starter): Likewise.
(cp_diagnostic_finalizer): Likewise.
(cp_print_error_function): Likewise.
(cp_printer): Take a secondary parameter as a 'text_info *'.
Remove output_state savings. Adjust calls.
2002-06-03 Geoffrey Keating <geoffk@redhat.com>
* pt.c (inline_parm_levels): Mark for GC.
......
2002-06-04 Gabriel Dos Reis <gdr@codesourcery.com>
* bad.c (ffebad_start_): Adjust call to count_error.
* Make-lang.in (f/bad.o): Depend on diagnostic.h
* bad.c: #include diagnostic.h
2002-06-03 Geoffrey Keating <geoffk@redhat.com>
* Make-lang.in (f/com.o): Depend on debug.h.
......
......@@ -352,7 +352,8 @@ f/bad.o: f/bad.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bad.h f/bad.def f/where.h \
glimits.h f/top.h f/malloc.h flags.h f/com.h f/com-rt.def $(TREE_H) f/bld.h \
f/bld-op.def f/bit.h f/info.h f/info-b.def f/info-k.def f/info-w.def \
f/target.h f/lex.h f/type.h f/intrin.h f/intrin.def f/lab.h f/symbol.h \
f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h toplev.h intl.h
f/symbol.def f/equiv.h f/storag.h f/global.h f/name.h toplev.h intl.h \
diagnostic.h
f/bit.o: f/bit.c f/proj.h $(CONFIG_H) $(SYSTEM_H) glimits.h f/bit.h \
f/malloc.h
f/bld.o: f/bld.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/bld.h f/bld-op.def f/bit.h \
......
......@@ -43,6 +43,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h"
#include "where.h"
#include "intl.h"
#include "diagnostic.h"
/* Externals defined here. */
......@@ -202,7 +203,7 @@ ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
if ((ffebad_severity_ != FFEBAD_severityPEDANTIC)
|| !flag_pedantic_errors)
{
if (count_error (1) == 0)
if (!diagnostic_count_error (global_dc, DK_WARNING))
{ /* User wants no warnings. */
ffebad_is_temp_inhibited_ = TRUE;
return FALSE;
......@@ -214,7 +215,7 @@ ffebad_start_ (bool lex_override, ffebad errnum, ffebadSeverity sev,
case FFEBAD_severityWEIRD:
case FFEBAD_severitySEVERE:
case FFEBAD_severityDISASTER:
count_error (0);
diagnostic_count_error (global_dc, DK_ERROR);
break;
default:
......@@ -420,7 +421,7 @@ ffebad_finish ()
{
if (bi != 0)
fputc ('\n', stderr);
report_error_function (fn);
diagnostic_report_current_function (global_dc);
fprintf (stderr,
/* the trailing space on the <file>:<line>: line
fools emacs19 compilation mode into finding the
......
......@@ -90,7 +90,7 @@ $(srcdir)/objc/objc-parse.y: $(srcdir)/c-parse.in
objc-act.o : $(srcdir)/objc/objc-act.c \
$(CONFIG_H) $(TREE_H) $(RTL_H) $(SYSTEM_H) $(EXPR_H) $(TARGET_H) \
$(C_COMMON_H) $(srcdir)/c-tree.h \
$(C_COMMON_H) $(srcdir)/c-tree.h $(srcdir)/diagnostic.h \
$(srcdir)/toplev.h $(srcdir)/flags.h $(srcdir)/objc/objc-act.h \
$(srcdir)/input.h $(srcdir)/function.h $(srcdir)/output.h $(srcdir)/debug.h \
$(srcdir)/langhooks.h $(LANGHOOKS_DEF_H) gtype-objc.h
......
......@@ -56,6 +56,7 @@ Boston, MA 02111-1307, USA. */
#include "ggc.h"
#include "debug.h"
#include "target.h"
#include "diagnostic.h"
/* This is the default way of generating a method name. */
/* I am not sure it is really correct.
......@@ -3415,9 +3416,9 @@ error_with_ivar (message, decl, rawdecl)
tree decl;
tree rawdecl;
{
count_error (0);
diagnostic_count_error (global_dc, DK_ERROR);
report_error_function (DECL_SOURCE_FILE (decl));
diagnostic_report_current_function (global_dc);
error_with_file_and_line (DECL_SOURCE_FILE (decl),
DECL_SOURCE_LINE (decl),
......@@ -6894,10 +6895,10 @@ warn_with_method (message, mtype, method)
int mtype;
tree method;
{
if (count_error (1) == 0)
if (!diagnostic_count_error (global_dc, DK_WARNING))
return;
report_error_function (DECL_SOURCE_FILE (method));
diagnostic_report_current_function (global_dc);
/* Add a readable method name to the warning. */
warning_with_file_and_line (DECL_SOURCE_FILE (method),
......
......@@ -32,7 +32,8 @@ Boston, MA 02111-1307, USA. */
#include "diagnostic.h"
static void file_and_line_for_asm PARAMS ((rtx, const char **, int *));
static void diagnostic_for_asm PARAMS ((rtx, const char *, va_list *, int));
static void diagnostic_for_asm PARAMS ((rtx, const char *, va_list *,
diagnostic_t));
/* Figure file and line of the given INSN. */
static void
......@@ -74,18 +75,18 @@ file_and_line_for_asm (insn, pfile, pline)
of the insn INSN. This is used only when INSN is an `asm' with operands,
and each ASM_OPERANDS records its own source file and line. */
static void
diagnostic_for_asm (insn, msg, args_ptr, warn)
diagnostic_for_asm (insn, msg, args_ptr, kind)
rtx insn;
const char *msg;
va_list *args_ptr;
int warn;
diagnostic_t kind;
{
diagnostic_context dc;
diagnostic_info diagnostic;
set_diagnostic_context (&dc, msg, args_ptr, NULL, 0, warn);
file_and_line_for_asm (insn, &diagnostic_file_location (&dc),
&diagnostic_line_location (&dc));
report_diagnostic (&dc);
diagnostic_set_info (&diagnostic, msg, args_ptr, NULL, 0, kind);
file_and_line_for_asm (insn, &diagnostic.location.file,
&diagnostic.location.line);
report_diagnostic (&diagnostic);
}
void
......@@ -95,7 +96,7 @@ error_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
VA_FIXEDARG (ap, rtx, insn);
VA_FIXEDARG (ap, const char *, msgid);
diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 0);
diagnostic_for_asm (insn, msgid, &ap, DK_ERROR);
VA_CLOSE (ap);
}
......@@ -106,7 +107,7 @@ warning_for_asm VPARAMS ((rtx insn, const char *msgid, ...))
VA_FIXEDARG (ap, rtx, insn);
VA_FIXEDARG (ap, const char *, msgid);
diagnostic_for_asm (insn, msgid, &ap, /* warn = */ 1);
diagnostic_for_asm (insn, msgid, &ap, DK_WARNING);
VA_CLOSE (ap);
}
......
......@@ -29,7 +29,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
extern int toplev_main PARAMS ((int, char **));
extern int read_integral_parameter PARAMS ((const char *, const char *,
const int));
extern int count_error PARAMS ((int));
extern void strip_off_ending PARAMS ((char *, int));
extern void print_time PARAMS ((const char *, long));
extern const char *trim_filename PARAMS ((const char *));
......@@ -67,7 +66,6 @@ extern void warning_with_file_and_line PARAMS ((const char *, int,
extern void error_with_file_and_line PARAMS ((const char *, int,
const char *, ...));
extern void sorry PARAMS ((const char *, ...));
extern void report_error_function PARAMS ((const char *));
extern void rest_of_decl_compilation PARAMS ((union tree_node *,
const char *, int, int));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment