Commit 46f018e1 by Gabriel Dos Reis

diagnostic.c (default_print_error_function): Tweak.


	* diagnostic.c (default_print_error_function): Tweak.
	(report_error_function): Likewise.
	* toplev.h (default_print_error_function): Move to...
	* diagnostic.h: ...here. Add a `diagnostic_context *' parameter.
	* tree.h (print_error_function): Move to...
	* diagnostic.h: ...here. Add a `diagnostic_context *' parameter.

ch/

	* lang.c: #include diagnostic.h
	(chill_print_error_function): Add a dummy `diagnostic_context *'.
	* Makefile.in (lang.o): Depend on diagnostic.h

cp/

	* error.c (lang_print_error_function): Add a `diagnostic_context *'
	parameter. Tweak.

f/

	* Make-lang.in (f/com.o): Depend on diagnostic.h
	* com.c: #include diagnostic.h
	(lang_print_error_function): Take a 'diagnostic_context *'.

java/

	* lang.c: #include diagnostic.h
	(lang_print_error): Add a `diagnostic_context *' parameter.
	(java_dummy_print): Likewise.
	* Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h

From-SVN: r43638
parent eeb35b45
2001-06-28 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.c (default_print_error_function): Tweak.
(report_error_function): Likewise.
* toplev.h (default_print_error_function): Move to...
* diagnostic.h: ...here. Add a `diagnostic_context *' parameter.
* tree.h (print_error_function): Move to...
* diagnostic.h: ...here. Add a `diagnostic_context *' parameter.
Thu Jun 28 06:16:45 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (expand_assignment): When have varying-length object,
......
2001-06-28 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
* lang.c: #include diagnostic.h
(chill_print_error_function): Add a dummy `diagnostic_context *'.
* Makefile.in (lang.o): Depend on diagnostic.h
2001-06-10 Gabriel Dos Reis <gdr@codesourcery.com>
* decl.c: #include diagnostic.h
......
......@@ -286,7 +286,8 @@ grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h $(EXPR_H) $(RTL_H)
$(srcdir)/../system.h $(srcdir)/../toplev.h $(EXPR_H) $(RTL_H) \
$(srcdir)/../diagnostic.h
lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h lex.h $(srcdir)/../dwarfout.h hash.h
......
......@@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "rtl.h"
#include "expr.h"
#include "diagnostic.h"
/* Type node for boolean types. */
......@@ -54,7 +55,8 @@ const char* chill_real_input_filename;
extern FILE* finput;
static int deep_const_expr PARAMS ((tree));
static void chill_print_error_function PARAMS ((const char *));
static void chill_print_error_function PARAMS ((diagnostic_context *,
const char *));
/* Return 1 if the expression tree given has all
constant nodes as its leaves,otherwise. */
......@@ -229,7 +231,8 @@ lang_decode_option (argc, argv)
}
static void
chill_print_error_function (file)
chill_print_error_function (context, file)
diagnostic_context *buffer __attribute__((__unused__));
const char *file;
{
static tree last_error_function = NULL_TREE;
......
2001-06-28 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
* error.c (lang_print_error_function): Add a `diagnostic_context *'
parameter. Tweak.
2001-06-27 Neil Booth <neil@cat.daikokuya.demon.co.uk>
* decl2.c (import_export_class): Update.
......
......@@ -116,7 +116,8 @@ static void dump_scope PARAMS ((tree, int));
static void dump_template_parms PARAMS ((tree, int, int));
static const char *function_category PARAMS ((tree));
static void lang_print_error_function PARAMS ((const char *));
static void lang_print_error_function PARAMS ((diagnostic_context *,
const char *));
static void maybe_print_instantiation_context PARAMS ((output_buffer *));
static void print_instantiation_full_context PARAMS ((output_buffer *));
static void print_instantiation_partial_context PARAMS ((output_buffer *, tree,
......@@ -2470,16 +2471,17 @@ cv_to_string (p, v)
}
static void
lang_print_error_function (file)
lang_print_error_function (context, file)
diagnostic_context *context;
const char *file;
{
output_state os;
default_print_error_function (file);
os = output_buffer_state (diagnostic_buffer);
output_set_prefix (diagnostic_buffer, file);
maybe_print_instantiation_context (diagnostic_buffer);
output_buffer_state (diagnostic_buffer) = os;
default_print_error_function (context, file);
os = output_buffer_state (context);
output_set_prefix ((output_buffer *)context, file);
maybe_print_instantiation_context ((output_buffer *)context);
output_buffer_state (context) = os;
}
static void
......
......@@ -121,8 +121,8 @@ static int last_error_tick;
/* Called by report_error_function to print out function name.
Default may be overridden by language front-ends. */
void (*print_error_function) PARAMS ((const char *)) =
default_print_error_function;
void (*print_error_function) PARAMS ((diagnostic_context *, const char *))
= default_print_error_function;
/* Prevent recursion into the error handler. */
static int diagnostic_lock;
......@@ -1204,35 +1204,36 @@ announce_function (decl)
an error. */
void
default_print_error_function (file)
const char *file;
default_print_error_function (context, file)
diagnostic_context *context;
const char *file;
{
if (error_function_changed ())
{
char *prefix = file ? build_message_string ("%s: ", file) : NULL;
output_state os;
os = output_buffer_state (diagnostic_buffer);
output_set_prefix (diagnostic_buffer, prefix);
os = output_buffer_state (context);
output_set_prefix ((output_buffer *)context, prefix);
if (current_function_decl == NULL)
output_add_string (diagnostic_buffer, _("At top level:"));
output_add_string ((output_buffer *)context, _("At top level:"));
else
{
if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
output_printf
(diagnostic_buffer, "In method `%s':",
((output_buffer *)context, "In member function `%s':",
(*decl_printable_name) (current_function_decl, 2));
else
output_printf
(diagnostic_buffer, "In function `%s':",
((output_buffer *)context, "In function `%s':",
(*decl_printable_name) (current_function_decl, 2));
}
output_add_newline (diagnostic_buffer);
output_add_newline ((output_buffer *)context);
record_last_error_function ();
output_buffer_to_stream (diagnostic_buffer);
output_buffer_state (diagnostic_buffer) = os;
output_buffer_to_stream ((output_buffer *)context);
output_buffer_state (context) = os;
free ((char*) prefix);
}
}
......@@ -1245,8 +1246,8 @@ void
report_error_function (file)
const char *file ATTRIBUTE_UNUSED;
{
report_problematic_module (diagnostic_buffer);
(*print_error_function) (input_filename);
report_problematic_module ((output_buffer *)global_dc);
(*print_error_function) (global_dc, input_filename);
}
void
......
......@@ -310,4 +310,12 @@ extern int error_function_changed PARAMS ((void));
extern void record_last_error_function PARAMS ((void));
extern void report_problematic_module PARAMS ((output_buffer *));
/* Called by report_error_function to print out function name.
* Default may be overridden by language front-ends. */
extern void (*print_error_function) PARAMS ((diagnostic_context *,
const char *));
extern void default_print_error_function PARAMS ((diagnostic_context *,
const char *));
#endif /* ! GCC_DIAGNOSTIC_H */
2001-06-28 Gabriel Dos Reis <gdr@codesourcery.com>
* Make-lang.in (f/com.o): Depend on diagnostic.h
* com.c: #include diagnostic.h
(lang_print_error_function): Take a 'diagnostic_context *'.
Wed Jun 13 11:22:39 2001 Mark Mitchell <mark@codesourcery.com>
* BUGS: Remove.
......
......@@ -417,7 +417,7 @@ f/com.o: f/com.c f/proj.h $(CONFIG_H) $(SYSTEM_H) flags.h $(RTL_H) $(TREE_H) \
f/malloc.h f/info.h f/info-b.def f/info-k.def f/info-w.def f/target.h f/bad.h \
f/bad.def f/where.h glimits.h f/top.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 f/expr.h f/implic.h f/src.h f/st.h $(GGC_H) toplev.h
f/name.h f/expr.h f/implic.h f/src.h f/st.h $(GGC_H) toplev.h diagnostic.h
f/data.o: f/data.c f/proj.h $(CONFIG_H) $(SYSTEM_H) f/data.h f/bld.h f/bld-op.def \
f/bit.h f/malloc.h f/com.h f/com-rt.def $(TREE_H) f/info.h f/info-b.def \
f/info-k.def f/info-w.def f/target.h f/bad.h f/bad.def f/where.h glimits.h \
......
......@@ -89,6 +89,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "output.h" /* Must follow tree.h so TREE_CODE is defined! */
#include "convert.h"
#include "ggc.h"
#include "diagnostic.h"
#endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
#define FFECOM_GCC_INCLUDE 1 /* Enable -I. */
......@@ -13989,7 +13990,7 @@ lang_printable_name (tree decl, int v)
#if BUILT_FOR_270
static void
lang_print_error_function (const char *file)
lang_print_error_function (diagnostic_context *context, const char *file)
{
static ffeglobal last_g = NULL;
static ffesymbol last_s = NULL;
......
2001-06-28 Gabriel Dos Reis <gdr@codesourcery.com>
* lang.c: #include diagnostic.h
(lang_print_error): Add a `diagnostic_context *' parameter.
(java_dummy_print): Likewise.
* Make-lang.in (JAVA_LEX_C): Depend on diagnostic.h
2001-06-27 Alexandre Petit-Bianco <apbianco@redhat.com>
* class.c (set_super_info): Call `set_class_decl_access_flags.'
......
......@@ -266,7 +266,7 @@ java/jcf-write.o: java/jcf-write.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
java/jv-scan.o: java/jv-scan.c $(CONFIG_H) $(SYSTEM_H) version.h
java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H)
java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \
toplev.h $(SYSTEM_H) $(RTL_H) $(EXPR_H)
toplev.h $(SYSTEM_H) $(RTL_H) $(EXPR_H) diagnostic.h
java/mangle.o: java/mangle.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) $(SYSTEM_H) \
toplev.h $(GGC_H)
java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) \
......
......@@ -37,6 +37,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "flags.h"
#include "xref.h"
#include "ggc.h"
#include "diagnostic.h"
struct string_option
{
......@@ -50,8 +51,8 @@ static void java_init_options PARAMS ((void));
static int java_decode_option PARAMS ((int, char **));
static void put_decl_string PARAMS ((const char *, int));
static void put_decl_node PARAMS ((tree));
static void java_dummy_print PARAMS ((const char *));
static void lang_print_error PARAMS ((const char *));
static void java_dummy_print PARAMS ((diagnostic_context *, const char *));
static void lang_print_error PARAMS ((diagnostic_context *, const char *));
static int process_option_with_no PARAMS ((char *,
struct string_option *,
int));
......@@ -592,7 +593,8 @@ lang_printable_name_wls (decl, v)
is the value of the hook print_error_function, called from toplev.c. */
static void
lang_print_error (file)
lang_print_error (context, file)
diagnostic_context *context __attribute__((__unused__));
const char *file;
{
static tree last_error_function_context = NULL_TREE;
......@@ -673,7 +675,8 @@ java_init ()
function prototypes. */
static void
java_dummy_print (s)
java_dummy_print (c, s)
diagnostic_context *c __attribute__ ((__unused__));
const char *s __attribute__ ((__unused__));
{
}
......
......@@ -84,7 +84,6 @@ extern void error_with_file_and_line PARAMS ((const char *, int,
ATTRIBUTE_PRINTF_3;
extern void sorry PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1;
extern void default_print_error_function PARAMS ((const char *));
extern void report_error_function PARAMS ((const char *));
extern void rest_of_decl_compilation PARAMS ((union tree_node *,
......
......@@ -2651,10 +2651,6 @@ extern void init_decl_processing PARAMS ((void));
/* Function to identify which front-end produced the output file. */
extern const char *lang_identify PARAMS ((void));
/* Called by report_error_function to print out function name.
* Default may be overridden by language front-ends. */
extern void (*print_error_function) PARAMS ((const char *));
/* Function to replace the DECL_LANG_SPECIFIC field of a DECL with a copy. */
extern void copy_lang_decl PARAMS ((tree));
......
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