* 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
+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
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
#include "toplev.h"
#include "rtl.h"
#include "expr.h"
+#include "diagnostic.h"
/* Type node for boolean types. */
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 *));
\f
/* Return 1 if the expression tree given has all
constant nodes as its leaves,otherwise. */
}
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.
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,
}
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
/* 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;
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);
}
}
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
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.
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 \
#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. */
#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.'
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) \
#include "flags.h"
#include "xref.h"
#include "ggc.h"
+#include "diagnostic.h"
struct string_option
{
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));
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;
function prototypes. */
static void
-java_dummy_print (s)
+java_dummy_print (c, s)
+ diagnostic_context *c __attribute__ ((__unused__));
const char *s __attribute__ ((__unused__));
{
}
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 *,
/* 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));