Makefile.in (c-parse.o): Depend on diagnostic.h

gcc/

2001-06-10  Mark Mitchell <mark@codesourcery.com>
	    Gabriel Dos Reis  <gdr@codesourcery.com>

	* Makefile.in (c-parse.o): Depend on diagnostic.h
	(dwarf2out.o): Likewise.

	* dwarf2out.c: #include diagnostic.h

	* toplev.h (warningcount, errorcount, sorrycount): Remove
	declarations.

	* toplev.c (warningcount, errorcount, sorrycount): Remove
	definitions.

	* diagnostic.h (struct output_buffer): Reorder fields.
	(diagnostic_kind_count): New macro.
	(errorcount, warningcount, sorrycount): Define as macros.
	(diagnostic_report_warnings_p): New macro.
	(output_state): Add diagnostic_count field.

	* diagnostic.c (warningcount, errorcount, inhibit_warnings):
	Remove tentative declaration.
	(count_error): Use diagnostic_report_warnings_p.

	* c-parse.in: #include diagnostic.h

ch/

2001-06-10  Gabriel Dos Reis  <gdr@codesourcery.com>

	* decl.c: #include diagnostic.h
	* actions.c: #include diagnostic.h
	* Makefile.in (actions.o): Depend on diagnostic.h
	(decl.o): Depend on diagnostic.h

cp/

2001-06-10  Mark Mitchell <mark@codesourcery.com>
	    Gabriel Dos Reis  <gdr@codesourcery.com>

	* Make-lang.in (cp/call.o): Depend on diagnostic.h
	(cp/typeck.o): Depend on diagnostic.h
	(cp/typeck2.o): Depend on diagnostic.h
	(cp/repo.o): Depend on dignostic.h
	* typeck.c: #include diagnostic.h
	(convert_for_initialization): Remove extern declaration for
	warningcount and errorcount.

	* call.c: #include diagnostic.h
	(convert_like_real): Remove extern declaration for warnincount and
	errorcount.

	* repo.c: #include diagnostic.h
	* typeck2.c: #include diagnostic.h

From-SVN: r43140
This commit is contained in:
Gabriel Dos Reis 2001-06-10 13:48:04 +00:00
parent 3f0ae30efc
commit 2a2b2d432e
18 changed files with 106 additions and 31 deletions

View File

@ -1,3 +1,29 @@
2001-06-10 Mark Mitchell <mark@codesourcery.com>
Gabriel Dos Reis <gdr@codesourcery.com>
* Makefile.in (c-parse.o): Depend on diagnostic.h
(dwarf2out.o): Likewise.
* dwarf2out.c: #include diagnostic.h
* toplev.h (warningcount, errorcount, sorrycount): Remove
declarations.
* toplev.c (warningcount, errorcount, sorrycount): Remove
definitions.
* diagnostic.h (struct output_buffer): Reorder fields.
(diagnostic_kind_count): New macro.
(errorcount, warningcount, sorrycount): Define as macros.
(diagnostic_report_warnings_p): New macro.
(output_state): Add diagnostic_count field.
* diagnostic.c (warningcount, errorcount, inhibit_warnings):
Remove tentative declaration.
(count_error): Use diagnostic_report_warnings_p.
* c-parse.in: #include diagnostic.h
2001-06-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.md ("extendhisi2"): Fix constraints to

View File

@ -1133,7 +1133,8 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H)
c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) flags.h \
diagnostic.h $(TM_P_H)
c-parse.o : $(srcdir)/c-parse.c $(CONFIG_H) $(TREE_H) c-lex.h $(GGC_H) intl.h \
$(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h cpplib.h
$(C_TREE_H) input.h flags.h $(SYSTEM_H) toplev.h output.h cpplib.h \
diagnostic.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c $(srcdir)/c-parse.c
$(srcdir)/c-parse.c: $(srcdir)/c-parse.y
@ -1386,7 +1387,7 @@ sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h except.h
dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.h \
flags.h insn-config.h reload.h output.h toplev.h dwarfout.h $(TM_P_H)
dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf2.h \
flags.h insn-config.h reload.h output.h \
flags.h insn-config.h reload.h output.h diagnostic.h \
hard-reg-set.h $(REGS_H) $(EXPR_H) toplev.h dwarf2out.h varray.h \
$(GGC_H) except.h dwarf2asm.h $(TM_P_H)
dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \

View File

@ -51,6 +51,7 @@ end ifc
#include "output.h"
#include "toplev.h"
#include "ggc.h"
#include "diagnostic.h"
#ifdef MULTIBYTE_CHARS
#include <locale.h>

View File

@ -1,3 +1,10 @@
2001-06-10 Gabriel Dos Reis <gdr@codesourcery.com>
* decl.c: #include diagnostic.h
* actions.c: #include diagnostic.h
* Makefile.in (actions.o): Depend on diagnostic.h
(decl.o): Depend on diagnostic.h
2001-06-02 Joseph S. Myers <jsm28@cam.ac.uk>
* chill.texi: Move contents to just after title page.

View File

@ -269,12 +269,12 @@ $(srcdir)/hash.h:
actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
lex.h $(srcdir)/../flags.h $(srcdir)/../input.h \
$(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
$(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h diagnostic.h
convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
$(srcdir)/../convert.h
decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
$(srcdir)/../system.h $(srcdir)/../toplev.h diagnostic.h
except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
$(srcdir)/../system.h $(srcdir)/../toplev.h
expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \

View File

@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
#include "assert.h"
#include "toplev.h"
#include "diagnostic.h"
static int id_cmp PARAMS ((tree *, tree *));
static void warn_unhandled PARAMS ((const char *));

View File

@ -191,6 +191,7 @@ Boston, MA 02111-1307, USA. */
#include "input.h"
#include "rtl.h"
#include "toplev.h"
#include "diagnostic.h"
#define IS_UNKNOWN_TYPE(type) (TYPE_SIZE(type)==0)
#define BUILTIN_NESTING_LEVEL (-1)

View File

@ -1,3 +1,21 @@
2001-06-10 Mark Mitchell <mark@codesourcery.com>
Gabriel Dos Reis <gdr@codesourcery.com>
* Make-lang.in (cp/call.o): Depend on diagnostic.h
(cp/typeck.o): Depend on diagnostic.h
(cp/typeck2.o): Depend on diagnostic.h
(cp/repo.o): Depend on dignostic.h
* typeck.c: #include diagnostic.h
(convert_for_initialization): Remove extern declaration for
warningcount and errorcount.
* call.c: #include diagnostic.h
(convert_like_real): Remove extern declaration for warnincount and
errorcount.
* repo.c: #include diagnostic.h
* typeck2.c: #include diagnostic.h
2001-06-08 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (duplicate_decls): Fix DECL_TEMPLATE_RESULT thinko

View File

@ -245,10 +245,13 @@ cp/decl.o: cp/decl.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h stack.h \
cp/operators.def $(TM_P_H)
cp/decl2.o: cp/decl2.c $(CXX_TREE_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
output.h except.h toplev.h dwarf2out.h dwarfout.h $(GGC_H) $(RTL_H)
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h $(TM_P_H)
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) flags.h toplev.h output.h $(TM_P_H) \
diagnostic.h
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
diagnostic.h
cp/class.o: cp/class.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H)
cp/call.o: cp/call.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H) $(EXPR_H) $(GGC_H)
cp/call.o: cp/call.c $(CXX_TREE_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \
$(GGC_H) diagnostic.h
cp/friend.o: cp/friend.c $(CXX_TREE_H) flags.h $(RTL_H) toplev.h $(EXPR_H)
cp/init.o: cp/init.c $(CXX_TREE_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \
$(GGC_H) except.h
@ -269,7 +272,7 @@ cp/pt.o: cp/pt.c $(CXX_TREE_H) cp/decl.h cp/parse.h cp/lex.h toplev.h \
$(GGC_H) $(RTL_H) except.h
cp/error.o: cp/error.c $(CXX_TREE_H) toplev.h diagnostic.h
cp/errfn.o: cp/errfn.c $(CXX_TREE_H) toplev.h
cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H)
cp/repo.o: cp/repo.c $(CXX_TREE_H) toplev.h $(GGC_H) diagnostic.h
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) cp/lex.h except.h toplev.h \
flags.h $(GGC_H) output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H)
cp/dump.o: cp/dump.c $(CXX_TREE_H) c-dump.h

View File

@ -34,6 +34,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "expr.h"
#include "ggc.h"
#include "diagnostic.h"
extern int inhibit_warnings;
@ -3716,7 +3717,6 @@ convert_like_real (convs, expr, fn, argnum, inner)
int argnum;
int inner;
{
extern int warningcount, errorcount;
int savew, savee;
tree totype = TREE_TYPE (convs);

View File

@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA. */
#include "obstack.h"
#include "toplev.h"
#include "ggc.h"
#include "diagnostic.h"
static tree repo_get_id PARAMS ((tree));
static char *extract_string PARAMS ((char **));

View File

@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "output.h"
#include "toplev.h"
#include "diagnostic.h"
static tree convert_for_assignment PARAMS ((tree, tree, const char *, tree,
int));
@ -6431,7 +6432,6 @@ convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
if (codel == REFERENCE_TYPE)
{
/* This should eventually happen in convert_arguments. */
extern int warningcount, errorcount;
int savew = 0, savee = 0;
if (fndecl)

View File

@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
#include "flags.h"
#include "toplev.h"
#include "output.h"
#include "diagnostic.h"
static tree process_init_constructor PARAMS ((tree, tree, tree *));

View File

@ -103,10 +103,7 @@ static void default_diagnostic_finalizer PARAMS ((output_buffer *,
static void error_recursion PARAMS ((void)) ATTRIBUTE_NORETURN;
extern int rtl_dump_and_exit;
extern int inhibit_warnings;
extern int warnings_are_errors;
extern int warningcount;
extern int errorcount;
/* Front-end specific tree formatter, if non-NULL. */
printer_fn lang_printer = NULL;
@ -1049,9 +1046,7 @@ int
count_error (warningp)
int warningp;
{
if (warningp
&& (inhibit_warnings
|| (in_system_header && !warn_system_headers)))
if (warningp && !diagnostic_report_warnings_p ())
return 0;
if (warningp && !warnings_are_errors)

View File

@ -55,9 +55,11 @@ typedef struct
{
/* The prefix for each new line. */
const char *prefix;
/* The real upper bound of number of characters per line, taking into
account the case of a very very looong prefix. */
int maximum_length;
/* The ideal upper bound of number of characters per line, as suggested
by front-end. */
int ideal_maximum_length;
@ -77,11 +79,16 @@ typedef struct
o DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE: emit current PREFIX each time
a physical line is started. */
int prefixing_rule;
/* The current char to output. Updated by front-end (*format_map) when
it is called to report front-end printer for a specified format. */
const char *cursor;
/* A pointer to the variable argument-list for formatting. */
va_list *format_args;
/* The number of times we have issued diagnostics. */
int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND];
} output_state;
/* The output buffer datatype. This is best seen as an abstract datatype. */
@ -90,16 +97,20 @@ struct output_buffer
/* Internal data. These fields should not be accessed directly by
front-ends. */
/* Where to output formatted text. */
FILE* stream;
/* The obstack where the text is built up. */
struct obstack obstack;
/* The amount of characters output so far. */
int line_length;
/* The current state of the buffer. */
output_state state;
/* Where to output formatted text. */
FILE* stream;
/* The obstack where the text is built up. */
struct obstack obstack;
/* The amount of characters output so far. */
int line_length;
};
#define output_buffer_state(BUFFER) (BUFFER)->state
#define output_buffer_attached_stream(BUFFER) (BUFFER)->stream
#define output_buffer_text_cursor(BUFFER) (BUFFER)->state.cursor
#define output_buffer_format_args(BUFFER) *((BUFFER)->state.format_args)
@ -178,6 +189,23 @@ extern int diagnostic_message_length_per_line;
has been removed. */
extern output_buffer *diagnostic_buffer;
#define diagnostic_kind_count(BUFFER, DK) \
(BUFFER)->state.diagnostic_count[(int) DK]
/* The number of errors that have been issued so far. Ideally, these
would take an output_buffer as an argument. */
#define errorcount diagnostic_kind_count (diagnostic_buffer, DK_ERROR)
/* Similarly, but for warnings. */
#define warningcount diagnostic_kind_count (diagnostic_buffer, DK_WARNING)
/* Similarly, but for sorrys. */
#define sorrycount diagnostic_kind_count (diagnostic_buffer, DK_SORRY)
/* Returns non-zero if warnings should be emitted. */
#define diagnostic_report_warnings_p() \
(!inhibit_warnings \
&& !(in_system_header && !warn_system_headers))
/* Prototypes */
extern void set_diagnostic_context PARAMS ((diagnostic_context *,
const char *, va_list *,

View File

@ -56,6 +56,7 @@ Boston, MA 02111-1307, USA. */
#include "ggc.h"
#include "md5.h"
#include "tm_p.h"
#include "diagnostic.h"
/* DWARF2 Abbreviation Glossary:
CFA = Canonical Frame Address

View File

@ -379,12 +379,6 @@ int optimize = 0;
int optimize_size = 0;
/* Number of error messages and warning messages so far. */
int errorcount = 0;
int warningcount = 0;
int sorrycount = 0;
/* Nonzero if we should exit after parsing options. */
static int exit_after_options = 0;

View File

@ -132,9 +132,6 @@ extern void note_deferral_of_defined_inline_function
PARAMS ((union tree_node *));
extern void note_outlining_of_inline_function
PARAMS ((union tree_node *));
extern int errorcount;
extern int warningcount;
extern int sorrycount;
extern const char *progname;
extern const char *dump_base_name;