Commit Graph

278 Commits

Author SHA1 Message Date
Gabriel Dos Reis 0761f342c5 * diagnostic.c (announce_function): Move to toplev.c.
From-SVN: r71146
2003-09-06 21:33:46 +00:00
Gabriel Dos Reis b6fe0bb8c5 Remove pedwarn_with_decl, warning_with_decl and error_with_decl from GCC.
Remove pedwarn_with_decl, warning_with_decl and error_with_decl
        from GCC.
        * calls.c (try_to_integrate): Don't use xxx_with_decl.
        (expand_call): Likewise.
        * dwarfout.c (output_reg_number): Likewise.
        * expr.c (expand_expr): Likewise.
        * function.c (assign_temp): Likewise.
        (uninitialized_vars_warning): Likewise.
        (setjmp_args_warning): Likewise.
        (expand_function_end): Likewise.
        * stmt.c (fixup_gotos): Likewise.
        (warn_about_unused_variables): Likewise.
        (expand_end_bindings): Likewise.
        * stor-layout.c (layout_decl): Likewise.
        (place_field): Likewise.
        * toplev.c (check_global_declarations): Likewise.
        (rest_of_handle_inlining): Likewise.
        (default_tree_printer): New function.
        (general_init): Initialize diagnostic machinery before routing
        signals to the ICE machinery.  Set default tree printer.
        * toplev.h (pedwarn_with_decl): Remove declaration.
        (warning_with_decl): Likewise.
        (error_with_decl): Likewise.
        (pedwarn): Remove attribute for the time being.
        * tree-inline.c (expand_call_inline): Don't use xxx_with_decl.
        * varasm.c (named_section): Likewise.
        (make_decl_rtl): Likewise.
        (assemble_variable): Likewise.
        (merge_weak): Likewise.
        (declare_weak): Likewise.

        * diagnostic.h: Move non-diagnostic stuff into pretty-print.h.
        * diagnostic.c: Move non-diagnostic stuff into pretty-print.c.
        (format_with_decl): Remove.
        (diagnostic_for_decl): Likewise.
        (pedwarn_with_decl): Likewise.
        (warning_with_decl): Likewise.
        (error_with_decl): Likewise.
        (diagnostic_initialize): Adjust.
        (diagnostic_count_diagnostic): Likewise.
        (announce_function): Likewise.
        (lhd_print_error_function): Likewise.
        (diagnostic_report_current_module): Likewise.
        (default_diagnostic_starter): Likewise.
        (diagnostic_report_diagnostic): Likewise.
        (default_diagnostic_finalizer): Likewise.
        (verbatim): Likewise.
        (error): Likewise.
        (warning): Likewise.
        * opts.c (common_handle_option): Likewise.
        * pretty-print.c: New file.
        * c-pretty-print.h (pp_base): Override.
        * c-pretty-print.c: Adjust use of macros throughout.
        (pp_buffer): New macro.
        (pp_newline): Likewise.
        * c-objc-common.c (c_tree_printer): Adjust prototype. Tidy.
        * Makefile.in (DIAGNOSTIC_H): New variable.
        (c-errors.o): Use it.
        (c-objc-common.o): Likewise.
        (c-common.o): Likewise.
        (c-opts.o): Likewise.
        (c-format.o): Likewise.
        (diagnostic.o): Likewise.
        (opts.o): Likewise.
        (toplev.o): Likewise.
        (rtl-error.o): Likewise.
        (dwarf2out.o): Likewise.
        (jump.o): Likewise.
        (pretty-print.o): New rule.

cp/
        * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H.
        * error.c: Use the new pretty-printer fraamework.

From-SVN: r69773
2003-07-25 09:52:32 +00:00
Kazu Hirata 938d968ed3 alias.c: Fix comment formatting.
* alias.c: Fix comment formatting.
	* c-common.c: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* combine.c: Likewise.
	* cpplib.c: Likewise.
	* diagnostic.c: Likewise.
	* dojump.c: Likewise.
	* final.c: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcse.c: Likewise.
	* ggc-page.c: Likewise.
	* jump.c: Likewise.
	* loop.c: Likewise.
	* mips-tfile.c: Likewise.
	* recog.c: Likewise.
	* regclass.c: Likewise.
	* regmove.c: Likewise.
	* tree.c: Likewise.
	* tree.h: Likewise.

From-SVN: r69689
2003-07-22 23:15:30 +00:00
Per Bothner 53f72d60b6 diagnostic.c. (diagnostic_report_current_module): Update to match 2003-06-05 changes to push_srcloc and pop_srcloc.
* diagnostic.c.(diagnostic_report_current_module):  Update to match
	2003-06-05 changes to push_srcloc and pop_srcloc.

From-SVN: r69687
2003-07-22 16:10:22 -07:00
Gabriel Dos Reis b0e3f7ec30 re PR c++/11531 (ICE on invalid code (returning to void))
PR c++/11531
        * diagnostic.c (diagnostic_report_diagnostic): Don't ICE if we're
        not recursing on hard error.
        (diagnostic_for_decl): Likewise.
        * diagnostic.def: Rearrange.

cp/
        * typeck.c (check_return_expr): Fix thinko in diagnostic.

From-SVN: r69425
2003-07-15 23:31:52 +00:00
Andreas Jaeger 5671bf2771 genextract.c: Convert remaining prototypes to ISO C90.
2003-07-07  Andreas Jaeger  <aj@suse.de>

	* genextract.c: Convert remaining prototypes to ISO C90.

	* cpplex.c (_cpp_free_buff): Convert prototype to ISO C90.
	* fold-const.c (fold_single_bit_test): Likewise.
	* diagnostic.c (default_diagnostic_finalizer): Likewise.
	* cfgrtl.c (rtl_redirect_edge_and_branch): Likewise.

	* gengtype.c (write_array): Generate ISO C90 prototypes.

	* genflags.c (gen_proto): Generate ISO C90 prototypes.


For cp:
2003-07-07  Andreas Jaeger  <aj@suse.de>

	* friend.c: Convert to ISO C90 prototypes.

	* Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output
	language.
	* cfns.h: Regenerate.

	* typeck.c: Convert remaining prototypes to ISO C90.
	* search.c: Likewise.

	* decl2.c (build_expr_from_tree): Convert prototype to ISO C90.
	* semantics.c (expand_or_defer_fn): Likewise
	* mangle.c (discriminator_for_string_literal): Likewise.
	* g++spec.c (lang_specific_driver): Likewise.

	* search.c (lookup_base_r): Remove unused variable.

From-SVN: r69050
2003-07-07 21:11:59 +02:00
Kazu Hirata e0bb17a83f basic-block.h: Fix comment typos.
* basic-block.h: Fix comment typos.
	* bb-reorder.c: Likewise.
	* c-format.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfghooks.h: Likewise.
	* cfgloop.c: Likewise.
	* cfgloopmanip.c: Likewise.
	* cfgrtl.c: Likewise.
	* cgraph.h: Likewise.
	* cgraphunit.c: Likewise.
	* combine.c: Likewise.
	* convert.c: Likewise.
	* dbxout.c: Likewise.
	* df.c: Likewise.
	* df.h: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* et-forest.h: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.h: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.
	* genautomata.c: Likewise.
	* ggc-common.c: Likewise.
	* ggc-page.c: Likewise.
	* loop-unroll.c: Likewise.
	* loop-unswitch.c: Likewise.
	* loop.c: Likewise.
	* mips-tfile.c: Likewise.
	* optabs.c: Likewise.
	* ra-build.c: Likewise.
	* ra-colorize.c: Likewise.
	* ra-rewrite.c: Likewise.
	* ra.h: Likewise.
	* regmove.c: Likewise.
	* reload.c: Likewise.
	* rtlanal.c: Likewise.
	* sched-ebb.c: Likewise.
	* sched-int.h: Likewise.
	* sched-vis.c: Likewise.
	* sreal.c: Likewise.
	* ssa-ccp.c: Likewise.
	* ssa.c: Likewise.
	* toplev.c: Likewise.
	* tree-inline.c: Likewise.
	* value-prof.c: Likewise.
	* value-prof.h: Likewise.

From-SVN: r68770
2003-07-01 12:18:01 +00:00
Kazu Hirata f9da506452 alloc-pool.c: Fix comment formatting.
* alloc-pool.c: Fix comment formatting.
	* bitmap.c: Likewise.
	* bitmap.h: Likewise.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* caller-save.c: Likewise.
	* cfganal.c: Likewise.
	* cfgrtl.c: Likewise.
	* collect2.c: Likewise.
	* cse.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* expmed.c: Likewise.
	* final.c: Likewise.
	* flags.h: Likewise.
	* fold-const.c: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* genattrtab.c: Likewise.
	* genautomata.c: Likewise.
	* libgcov.c: Likewise.
	* mips-tfile.c: Likewise.
	* optabs.c: Likewise.
	* prefix.c: Likewise.
	* rtlanal.c: Likewise.
	* stmt.c: Likewise.
	* stor-layout.c: Likewise.
	* toplev.c: Likewise.
	* varasm.c: Likewise.
	* vmsdbgout.c: Likewise.

From-SVN: r68672
2003-06-29 13:53:12 +00:00
Nathan Sidwell 9a472a4224 diagnostic.h (diagnostic_set_info): Replace file and lineno parameters with a location_t.
* diagnostic.h (diagnostic_set_info): Replace file and lineno
	parameters with a location_t.
	* diagnostic.c (diagnostic_set_info): Replace file and lineno
	parameters with a location_t.
	(inform, warning, pedwarn, error, sorry, fatal_error,
	internal_error, warning_with_decl, pedwarn_with_decl,
	error_with_decl): Adjust.
	* c-error.c (pedwarn_c99): Adjust.
	* c-format.c (status_warning): Adjust.
	* rtl-error.c (file_and_line_for_asm): Rename to ...
	(location_for_asm): Return a location_t.
	(diagnostic_for_asm): Adjust.

	* cp/cp-tree.h (cp_line_of, cp_file_of): Remove.
	* cp/error.c (cp_line_of, cp_file_of): Merge into ...
	(location_of): ... here. Make static, return a location_t.
	(cp_error_at, cp_warning_at, cp_pedwarn_at): Adjust.

	* testsuite/g++.old-deja/g++.robertl/eb133.C: Set expected line
	number.
	* testsuite/g++.old-deja/g++.robertl/eb133a.C: Likewise.
	* testsuite/g++.old-deja/g++.robertl/eb133b.C: Likewise.

From-SVN: r68643
2003-06-28 16:23:29 +00:00
Gabriel Dos Reis c707a408ca diagnostic.c (output_integer_with_precision): New macro.
* diagnostic.c (output_integer_with_precision): New macro.
	(output_format): Use it.  Handle more format specifiers.
	(output_long_decimal): Remove.
	(output_unsigned_decimal): Likewise.
	(output_long_unsigned_decimal): Likewise.
	(output_octal): Likewise.
	(output_long_octal): Likewise.
	(output_hexadecimal): Likewise.
	(output_long_hexadecimal): Likewise.
	(output_long_long_decimal): Likewise.

From-SVN: r68638
2003-06-28 13:40:31 +00:00
Kazu Hirata 71c0e7fc96 basic-block.h: Fix comment formatting.
* basic-block.h: Fix comment formatting.
	* bt-load.c: Likewise.
	* builtins.c: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-format.c: Likewise.
	* coverage.c: Likewise.
	* cpplib.h: Likewise.
	* cpppch.c: Likewise.
	* dbxout.c: Likewise.
	* diagnostic.c: Likewise.
	* dwarf2out.c: Likewise.
	* expr.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* gcc.c: Likewise.
	* gcov-io.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* profile.c: Likewise.
	* real.h: Likewise.
	* sched-deps.c: Likewise.

From-SVN: r68369
2003-06-23 15:27:37 +00:00
Gabriel Dos Reis 0e9e3a8b78 diagnostic.h (output_host_wide_integer): Declare.
* diagnostic.h (output_host_wide_integer): Declare.
	* diagnostic.c (output_long_long_decicaml): New function.
	(output_host_wide_integer): Likewise.
	(output_format): Use them.  Handle "%ll" and "%w".

From-SVN: r68323
2003-06-22 08:05:39 +00:00
Neil Booth e01cc6dc62 c-decl.c (store_parm_decls): Make saved_warn_shadow boolean.
* c-decl.c (store_parm_decls): Make saved_warn_shadow boolean.
	* common.opt: Add remaining -W options and -g.
	* diagnostic.c (warnings_are_errors): Remove.
	* flags.h: Make most warning flags boolean.
	* opts.c (common_handle_option): Handle remaining -W options, and -g.
	Move many warning flags from toplev.c, making them boolean.
	* toplev.c: Remove many warning flags.
	(decode_W_option): Remove.
	(decode_g_option): Make extern.  Error on unknown switch.
	(lang_independent_W_options): Use warn_dummy.
	(independent_decode_option): Just handle -f switches now.
	* toplev.h (decode_g_option): New.

From-SVN: r68287
2003-06-20 22:56:36 +00:00
Andreas Jaeger 79a490a95b predict.h: Convert to ISO C90 prototypes.
* predict.h: Convert to ISO C90 prototypes.
	* predict.c: Likewise.
	* tree-dump.h: Likewise.
	* tree-dump.c: Likewise.
	* diagnostic.h: Likewise.
	* diagnostic.c: Likewise.
	* combine.c: Likewise.

	* rtl.h: Convert prototypes of combine.c to ISO C90.

From-SVN: r67626
2003-06-08 16:21:54 +02:00
Kaveh R. Ghazi e34d07f255 builtins.c (validate_arglist): Eliminate libiberty VA_ macros, always use stdarg.
gcc:
	* builtins.c (validate_arglist): Eliminate libiberty VA_ macros,
	always use stdarg.
	* c-errors.c (pedwarn_c99): Likewise.
	* c-format.c (status_warning): Likewise.
	* c-semantics.c (build_stmt): Likewise.
	* calls.c (emit_library_call, emit_library_call_value): Likewise.
	* collect2.c (notice, fatal_perror, fatal, error): Likewise.
	* cpperror.c (cpp_error, cpp_error_with_line): Likewise.
	* diagnostic.c (build_message_string, output_printf,
	output_verbatim, verbatim, inform, warning, pedwarn, error, sorry,
	fatal_error, internal_error, warning_with_decl, pedwarn_with_decl,
	error_with_decl, fnotice): Likewise.
	* dwarf2asm.c (dw2_asm_output_data, dw2_asm_output_delta,
	dw2_asm_output_offset, dw2_asm_output_pcrel, dw2_asm_output_addr,
	dw2_asm_output_addr_rtx, dw2_asm_output_nstring,
	dw2_asm_output_data_uleb128, dw2_asm_output_data_sleb128,
	dw2_asm_output_delta_uleb128, dw2_asm_output_delta_sleb128,
	dw2_asm_output_encoded_addr_rtx): Likewise.
	* emit-rtl.c (gen_rtx, gen_rtvec): Likewise.
	* errors.c (warning, error, fatal, internal_error): Likewise.
	* final.c (output_operand_lossage, asm_fprintf): Likewise.
	* fix-header.c (fatal): Likewise.
	* gcc.c (fatal, error, notice): Likewise.
	* gcov.c (fnotice): Likewise.
	* genattrtab.c (attr_rtx, attr_printf): Likewise.
	* gengtype.c (error_at_line, xasprintf, oprintf): Likewise.
	* gensupport.c (message_with_line): Likewise.
	* mips-tfile.c (fatal, error): Likewise.
	* protoize.c (notice): Likewise.
	* ra-debug.c (ra_debug_msg): Likewise.
	* read-rtl.c (fatal_with_file_and_line): Likewise.
	* rtl-error.c (error_for_asm, warning_for_asm): Likewise.
	* tree.c (build, build_nt, build_function_type_list): Likewise.

cp:
	* error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate
	libiberty VA_ macros, always use stdarg.
	* rtti.c (create_pseudo_type_info): Likewise.
	* tree.c (build_min_nt, build_min): Likewise.

From-SVN: r66919
2003-05-17 22:21:35 +00:00
Zack Weinberg fa6ef81367 diagnostic.c (output_format): Add support for %m.
* diagnostic.c (output_format): Add support for %m.
	(output_printf, output_verbatim, diagnostic_set_info,
	verbatim): Set err_no field of the text_info structure being
	initialized.
	(fatal_io_error): Delete function.
	* diagnostic.h (text_info): Add err_no field.
	* toplev.h (fatal_io_error): Delete prototype.

	* c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c
	* toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c
	* f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c
	* objc/objc-act.c: Replace all calls to fatal_io_error with
	calls to fatal_error; add ": %m" to the end of all the affected
	error messages.

From-SVN: r66769
2003-05-13 18:06:52 +00:00
Zack Weinberg 9804f5fb8b diagnostic.c (diagnostic_for_decl): Take a diagnostic_context argument.
* diagnostic.c (diagnostic_for_decl): Take a
	diagnostic_context argument.  Restructure to be consistent
	with diagnostic_report_diagnostic.
	(diagnostic_count_diagnostic): Now static.  Take a
	diagnostic_info argument, not just a diagnostic_t.  Some code
	moved here from internal_error.  Move a case label for
	clarity.
	(diagnostic_action_after_output): New function.  Code moved
	here from internal_error and fatal_error.
	(bug_report_request): New #define so that this text appears in
	only one place.
	(diagnostic_report_diagnostic): Update to match changes to
	diagnostic_count_diagnostic.  Call diagnostic_action_after_output.
	(diagnostic_set_info): Call gettext here.

	(pedwarn): Update comment.  Don't call gettext here.
	(sorry): Use report_diagnostic.  Don't call gettext here.
	(fatal_error): Remove final fnotice and exit, but call
	real_abort to prevent warnings about noreturn function returning.
	(internal_error): Likewise.  Don't do ICE suppression here nor
	call context->internal_error.
	(warning_with_decl): Suppress for decls in system headers.
	Adjust call to diagnostic_for_decl.
	(pedwarn_with_decl): Likewise.
	(error_with_decl): Adjust call to diagnostic_for_decl.
	(error_recursion): Use bug_report_request.

	* diagnostic.h: Remove prototype of diagnostic_count_diagnostic.
	* objc/objc-act.c (error_with_ivar, warn_with_method): Don't call
	diagnostic_count_diagnostic.
f:
	* bad.c: Don't call diagnostic_count_diagnostic.

From-SVN: r66728
2003-05-12 18:32:18 +00:00
Zack Weinberg 59650e480e diagnostic.c: Reorder functions for clarity...
* diagnostic.c: Reorder functions for clarity, putting all the
	functions in the "error" family next to each other, and
	likewise all the functions in the "error_with_decl" family.
	Some other routines were moved too.  Add comments.
	(vbuild_message_string): Fold into sole caller.

From-SVN: r66676
2003-05-11 02:06:12 +00:00
Gabriel Dos Reis 3c4b64384b toplev.h (warning_with_file_and_line): Don't declare.
* toplev.h (warning_with_file_and_line): Don't declare.
	(error_with_file_and_line): Likewise.
	* diagnostic.c (error_with_file_and_line): Remove.
	(warning_with_file_and_line): Likewise.

From-SVN: r66628
2003-05-09 10:08:19 +00:00
Gabriel Dos Reis c71f2ffd78 toplev.h (pedwarn_with_file_and_line): Don't declare.
* toplev.h (pedwarn_with_file_and_line): Don't declare.
	* diagnostic.c (pedwarn_with_file_and_line): Remove.

From-SVN: r66456
2003-05-04 15:18:21 +00:00
Wolfgang Bangerth 5ca5a6554e Clarify the comment before the abort we hit when a translated string contains invalid formats.
From-SVN: r66381
2003-05-02 07:34:52 -06:00
Nathan Sidwell 6060edcbe2 Makefile.in (TREE_H): Replace location.h with input.h.
* Makefile.in (TREE_H): Replace location.h with input.h.
	(GTFILES) Remove location.h
	(gt-lists.h): Replace gt-location.h with gt-input.h
	* input.h (input_filename, input_line): Remove variables.
	(location_s, location_t): Move from location.h.
	(input_location): New.
	(input_filename, input_line): New #defines.
	* location.h: Remove.
	* tree.h: Replace location.h with input.h.
	(input_filename, input_line): Remove.
	* diagnostic.h: Replace location.h with input.h.
	* gcc.h (input_filename, input_filename_length): Remove declarations.
	* toplev.c (input_filename, input_line): Remove.
	(input_location): Define.
	(push_srcloc, pop_srcloc): Adjust.
	* diagnostic.c (diagnostic_report_current_module): Adjust.
f:
	* lex.c (ffelex_file_pop_): Adjust file_stack member use.
	(ffelex_file_push_): Likewise.
	(ffelex_hash_): Likewise.
java:
	* lex.h (input_lineno): Remove declaration.
	* parse-scan.y: #include input.h.
	(input_filename): Remove declaration.
	(input_location): Add definition.
	(input_line): Remove definition.

From-SVN: r66378
2003-05-02 11:33:06 +00:00
Nathan Sidwell d479d37f5e input.h (lineno): Rename to ...
* input.h (lineno): Rename to ...
	(input_line): ... here.
	* tree.h (lineno): Rename to ...
	(input_line): ... here.
	* scan.h (lineno): Rename to ...
	(input_line): ... here.
	* toplev.c (lineno): Rename to ...
	(input_line): ... here.
	(push_srcloc, pop_srcloc):  Rename lineno to input_line.
	* c-common.c (c_expand_start_cond, fname_decl): Likewise.
	* c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag,
	store_parm_decls, c_expand_body_1): Likewise.
	* c-errors.c (pedwarn_c99): Likewise.
	* c-format.c (status_warning): Likewise.
	* c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise.
	* c-opts.c (c_common_post_options, c_common_parse_file): Likewise.
	* c-parse.in (save_filename, maybe_type_qual, ifc): Likwise.
	* c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var,
	gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt,
	genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt,
	genrtl_return_stmt, genrtl_for_stmt, build_break_stmt,
	build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt,
	prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise.
	* coverage.c (create_coverage): Likewise.
	* diagnostic.c (pedwarn, sorry, error, fatal_error,
	internal_error, warning, diagnostic_report_current_module,
	inform): Likewise.
	* expr.c (expand_expr): Likewise.
	* integrate.c (expand_inline_function,
	output_inline_function): Likewise.
	* rtl-error.c (file_and_line_for_asm): Likewise.
	* tree-inline.c (find_alloca_call, find_builtin_longjmp_call,
	walk_tree): Likewise.
	* tree.c (make_node): Likewise.
	* ada, cp, f, java, objc, treelang: Likewise.

	ada
	* trans.c (build_unit_elab, set_lineno): Rename lineno to
	input_line.
	* utils.c (pushdecl, create_label_decl, begin_subprog_body,
	end_subprog_body): Likewise.
	* utils2.c (build_call_raise): Likewise.

	cp
	* class.c (finish_struct): Rename lineno to input_line.
	* decl.c (push_binding_level, pop_binding_level,
	suspend_binding_level, resume_binding_level, make_label_decl,
	use_label, start_function): Likewise.
	* decl2.c (warn_if_unknown_interface,
	start_static_initialization_or_destruction,
	generate_ctor_or_dtor_function, finish_file): Likewise.
	* error.c (cp_line_of, print_instantiation_full_context,
	print_instantiation_context): Likewise.
	* except.c (check_handlers_1, check_handlers): Likewise.
	* init.c (create_temporary_var): Likewise.
	* method.c (use_thunk, synthesize_method): Likewise.
	* parser.c (cp_lexer_set_source_position_from_token,
	cp_lexer_get_preprocessor_token): Likewise.
	* pt.c (push_tinst_level, pop_tinst_level,
	tsubst_friend_function, instantiate_class_template, tsubst_decl,
	tsubst, tsubst_expr, instantiate_decl): Likewise.
	* semantics.c (genrtl_try_block, finish_label_stmt,
	begin_class_definition, expand_body,
	genrtl_finish_function): Likewise.
	* tree.c (build_min_nt, build_min): Likewise.

	f
	* ansify.c (die_unless): Rename lineno to input_line.
	* com.c (ffecom_subscript_check_, ffecom_do_entry_,
	ffecom_gen_sfuncdef_, ffecom_start_progunit_,
	ffecom_sym_transform_, ffecom_sym_transform_assign_,
	bison_rule_pushlevel_, bison_rule_compstmt_, finish_function,
	store_parm_decls): Likewise.
	* intrin.c (ffeintrin_fulfill_generic): Likewise.
	* lex.c (ffelex_hash_, ffelex_include_, ffelex_next_line_,
	ffelex_file_fixed, ffelex_file_free): Likewise.
	* std.c (ffestd_exec_end): Likewise.
	* ste.c (ffeste_emit_line_note_, ffeste_start_block_,
	ffeste_start_stmt_): Likewise.
	* ste.h (ffeste_filelinenum, ffeste_set_line): Likewise.

	java
	* lex.h (lineno): Rename to ...
	(input_line): ... here
	* parse-scan.y (lineno): Rename to ...
	(input_line): ... here.
	(reset_report): Rename lineno to input_line.
	* check-init.c (check_init): Likewise.
	* class.c (push_class): Likewise.
	* decl.c (complete_start_java_method, end_java_method): Likewise.
	* expr.c (expand_byte_code): Likewise.
	* jcf-parse.c (give_name_to_class, parse_class_file): Likewise.
	* jcf-write.c (generate_bytecode_insns): Likewise.
	* lex.c (java_init_lex, java_allocate_new_line,
	do_java_lex): Likewise.
	* parse.h (YYNOT_TWICE): Likewise.
	* parse.y (empty_statement, expression_statement,
	java_pop_parser_context, java_parser_context_save_global,
	yyerror, register_fields, method_header, safe_layout_class,
	find_in_imports_on_demand, create_artificial_method,
	source_end_java_method, start_complete_expand_method,
	build_thisn_assign, java_complete_lhs,
	maybe_absorb_scoping_block): Likewise.

	objc
	* objc-act.c (objc_init): Rename lineno to input_line.
	(build_module_descriptor, build_selector_translation_table,
	build_protocol_template, build_method_prototype_list_template,
	build_category_template, build_selector_table,
	build_class_template, build_super_template, build_ivar_template,
	build_ivar_list_template, build_method_list_template,
	build_method_template, add_instance_variable): Likewise.

	treelang
	* tree1.c (treelang_init): Rename lineno to input_line.

From-SVN: r66333
2003-05-01 16:13:36 +00:00
Gabriel Dos Reis 0e42348d22 * diagnostic.c (output_pointer): Use HOST_PTR_PRINTF.
From-SVN: r66295
2003-04-30 16:12:58 +00:00
Gabriel Dos Reis 10256cf5f6 diagnostic.h (output_formatted_scalar): Tweak.
* diagnostic.h (output_formatted_scalar): Tweak.
        * diagnostic.c (output_long_decimal): Likewise.
        (output_unsigned_decimal): Likewise.
        (output_long_unsigned_decimal): Likewise.
        (output_octal): Likewise.
        (output_long_octal): Likewise.
        (output_hexadecimal): Likewise.
        (output_long_hexadecimal): Likewise.
        (output_pointer): New function.
        (output_format): Use it.  Recognize "%p" format specifier.

From-SVN: r66287
2003-04-30 12:54:29 +00:00
Geoffrey Keating 886e08657e diagnostic.c (real_abort): New.
* diagnostic.c (real_abort): New.
	(diagnostic_report_diagnostic): Call real_abort on error.
	* diagnostic.h (diagnostic_abort_on_error): New.
	(struct diagnostic_context): Add abort_on_error field.
	* toplev.c (setup_core_dumping): New.
	(decode_d_option): Handle 'H' case.
	* doc/invoke.texi (Debugging Options): Document -dH.

From-SVN: r62753
2003-02-12 01:05:47 +00:00
Kazu Hirata 95bd1dd72f alias.c: Fix comment typos.
* alias.c: Fix comment typos.
	* basic-block.h: Likewise.
	* c-common.c: Likewise.
	* c-common.h: Likewise.
	* c-decl.c: Likewise.
	* c-opts.c: Likewise.
	* c-pragma.c: Likewise.
	* c-pretty-print.h: Likewise.
	* cfg.c: Likewise.
	* cfganal.c: Likewise.
	* cfgbuild.c: Likewise.
	* cfgcleanup.c: Likewise.
	* cfglayout.c: Likewise.
	* cfgrtl.c: Likewise.
	* convert.c: Likewise.
	* cpphash.h: Likewise.
	* cpplex.c: Likewise.
	* cpplib.h: Likewise.
	* df.h: Likewise.
	* diagnostic.c: Likewise.
	* diagnostic.h: Likewise.
	* dwarf2.h: Likewise.

From-SVN: r61462
2003-01-18 02:26:43 +00:00
Zack Weinberg 4977bab6ed Merge basic-improvements-branch to trunk
From-SVN: r60174
2002-12-16 18:23:00 +00:00
Gabriel Dos Reis 9fc910d1ea * diagnostic.c (sorry): Don't repeat "sorry, unimplemented" text.
From-SVN: r59113
2002-11-14 21:34:19 +00:00
Zack Weinberg 36624850a4 system.h (GCCBUGURL): Delete.
* system.h (GCCBUGURL): Delete.
	* version.c (bug_report_url): New.  Add commentary about
	modifying both these strings in modified distributions.
	* version.h: Declare bug_report_url.

	* diagnostic.c, gcc.c, gcov.c, java/gjavah.c, java/jcf-dump.c,
	java/jv-scan.c: Globally replace GCCBUGURL with bug_report_url.

From-SVN: r57932
2002-10-08 17:27:39 +00:00
Jason Merrill 236a2ac8cc diagnostic.c (output_add_identifier): New fn.
* diagnostic.c (output_add_identifier): New fn.
        * diagnostic.h: Declare it.

From-SVN: r57066
2002-09-12 10:23:42 -04:00
Gabriel Dos Reis 9d533cb558 diagnostic.c (fancy_abort): Don't repeat "internal error".
* diagnostic.c (fancy_abort): Don't repeat "internal error".
	* toplev.c (crash_signal): Likewise.

From-SVN: r56669
2002-08-29 23:32:49 +00:00
Gabriel Dos Reis 9b32718c73 diagnostic.h (output_formatted_scalar): Rename from output_formatted_integer.
* diagnostic.h (output_formatted_scalar): Rename from
        output_formatted_integer.
        * diagnostic.def: Add DK_DEBUG.
        * diagnostic.c (output_decimal): Adjust.
        (output_long_decimal): Likewise.
        (output_unsigned_decimal): Likewise.
        (output_octal): Likewise.
        (output_long_octal): Likewise.
        (output_hexadecimal): Likewise.
        (output_long_hexadecimal): Likewise.
        * c-pretty-print.c (pp_c_type_specifier): New function.
        (pp_c_specifier_qualifier_list): Likewise.
        (pp_c_abstract_declarator): Likewise.
        (pp_c_char): Replace pp_format_integer with pp_format_scalar.

From-SVN: r56236
2002-08-12 18:34:51 +00:00
Gabriel Dos Reis 04c1334cba diagnostic.c (inform): New function.
* diagnostic.c (inform): New function.
	* diagnostic.h (inform): Declare.

From-SVN: r56022
2002-08-04 14:38:40 +00:00
Gabriel Dos Reis f63c45ec8e pretty-print.h: Define more macros.
* pretty-print.h: Define more macros.
	* diagnostic.h (output_formatted_integer): Moved from...
	* diagnostic.c: ... here.

From-SVN: r55833
2002-07-29 08:26:45 +00:00
Neil Booth 4fa31c2aae defaults.h (obstack_chunk_alloc, [...]): Default definition.
* defaults.h (obstack_chunk_alloc, obstack_chunk_free):
	Default definition.
	* gcse.c: Don't define obstack_chunk_free.
	* collect2.c, conflict.c, df.c, diagnostic.c, fix-header.c,
	flow.c, gcc.c, genattrtab.c, genautomata.c, genflags.c, gensupport.c,
	integrate.c, loop.c, ra.c, read-rtl.c, regrename.c, reload1.c,
	reorg.c, tlink.c, tree.c, config/arm/arm.c, objc/objc-act.c:
	Don't define obstack macros.
cp:
	* class.c, method.c, pt.c, search.c: Similarly.

From-SVN: r55665
2002-07-23 06:22:05 +00:00
Kaveh R. Ghazi ef9772c835 diagnostic.c (diagnostic_kind_text): Const-ify.
* diagnostic.c (diagnostic_kind_text): Const-ify.
	* gengtype.c (lang_names): Likewise.

From-SVN: r54840
2002-06-20 16:59:01 +00:00
Eric Christopher 3aafa0bbab diagnostic.c (output_format): Fix thinko.
2002-06-13  Eric Christopher  <echristo@redhat.com>

	* diagnostic.c (output_format): Fix thinko.

From-SVN: r54602
2002-06-13 23:31:56 +00:00
Gabriel Dos Reis c92bcccb95 diagnostic.c (output_format): Recognize "%H" as a format specifier for a location_t.
* diagnostic.c (output_format): Recognize "%H" as a format
	specifier for a location_t.
	(text_specifies_location): New function.
	(diagnostic_set_info): Use it.

From-SVN: r54584
2002-06-13 12:40:54 +00:00
Gabriel Dos Reis 13f0d49cdf objc-act.c (warn_with_ivar): Adjust calls to diagnostic_count_error.
* objc/objc-act.c (warn_with_ivar): Adjust calls to
	diagnostic_count_error.
	(warn_with_method): Likewise.

	* diagnostic.h (warnings_are_errors_message): New field of
	diagnostic_context.
	(diagnostic_count_error): Rename to
	diagnostic_count_diagnostic to
	match semantics.
	* diagnostic.c: Adjust calls to diagnostic_count_error through
	out.
	(diagnostic_count_diagnostic): Make aware of other kinds of
	diagnostics.
	(diagnostic_initialize): Initialize
	warnings_are_errors_message field.

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

	    * bad.c (ffebad_start_): Adjust calls to
              diagnostic_count_error.

From-SVN: r54532
2002-06-11 23:11:34 +00:00
Gabriel Dos Reis caef5b46fb * diagnostic.c (diagnostic_build_prefix): Fix initialization.
From-SVN: r54343
2002-06-07 16:35:52 +00:00
Gabriel Dos Reis 4b1d52c7ae * diagnostic.c (diagnostic_build_prefix): Tidy.
From-SVN: r54337
2002-06-07 13:00:43 +00:00
Gabriel Dos Reis 47b69537e4 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
2002-06-05 19:35:45 +00:00
Gabriel Dos Reis 27e511e0d5 diagnostic.h (struct diagnostic_context): Add new member internal_error.
* diagnostic.h (struct diagnostic_context):  Add new member
	internal_error.
	(internal_error_function): Remove declaration.
	* diagnostic.c (internal_error_function): Remove definition..
	(internal_error): Adjust use.
ada/
	* misc.c (gnat_init): Adjust setting of internal_error_function.

From-SVN: r54179
2002-06-02 19:06:30 +00:00
Gabriel Dos Reis 167143a01e diagnostic.c (diagnostic_finish): Rename to output_flush.
* diagnostic.c (diagnostic_finish): Rename to output_flush.
	(clear_disgnostic_info): Rename to output_clear_data.  Use
	false
	instead of 0 for boolean value.
	Adjust function call throughout.

From-SVN: r54176
2002-06-02 17:36:29 +00:00
Kazu Hirata 3a538a6668 dbxout.c: Fix formatting.
* dbxout.c: Fix formatting.
	* dependence.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* doloop.c: Likewise.
	* dominance.c: Likewise.
	* doschk.c: Likewise.
	* dwarf2asm.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.

From-SVN: r53380
2002-05-11 10:47:05 +00:00
Gabriel Dos Reis bd6bec6be2 diagnostic.h (output_buffer_state): Redefine.
* diagnostic.h (output_buffer_state): Redefine.
	(output_format_decoder): New macro.
	(output_prefixing_rule): Likewise.
	(output_line_cutoff): Likewise.
	(diagnostic_format_decoder): Adjust.
	(diagnostic_prefixing_rule): Likewise.
	(diagnostic_line_cutoff): Likewise.
	(diagnostic_state): Likewise.
	(diagnostic_kind_count): Likewise.
	(diagnostic_buffer): Now a macro.

	* diagnostic.c (diagnostic_buffer): Remove definition.
	(output_is_line_wrapping): Adjust.
	(set_real_maximum_length): Likewise.
	(output_set_maximum_length): Likewise.
	(init_output_buffer): Likewise.
	(lhd_print_error_function): Likewise.
	(output_do_verbatim): Likewise.

cp/
	* error.c (cxx_print_error_function): Adjust call to macros.

From-SVN: r52307
2002-04-14 23:35:36 +00:00
Neil Booth b18101c75f diagnostic.c: Include langhooks-def.h.
* diagnostic.c: Include langhooks-def.h.
	* Makefile.in (diagnostic.o): Update.

From-SVN: r51674
2002-03-31 22:59:14 +00:00
Neil Booth 7cb3282270 diagnostic.c (print_error_function): Remove.
* diagnostic.c (print_error_function): Remove.
	(default_print_error_function): Rename.
	(report_error_function): Update.
	* diagnostic.h (print_error_function): Remove.
	(default_print_error_function): Remove.
	* langhooks-def.h (struct diagnostic_context): Predeclare.
	(lhd_print_error_function, LANG_HOOKS_PRINT_ERROR_FUNCTION): New.
	(LANG_HOOKS_INITIALIZER): Update.
	* langhooks.h (struct diagnostic context): Predeclare.
	(struct lang_hooks): New hook.
cp:
	* Make-lang.in (error.o): Update.
	* cp-lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
	* cp-tree.h (struct diagnostic_context): Predeclare.
	(cxx_print_error_function): New.
	* error.c: Include langhooks-def.h.
	(lang_print_error_function): Rename.  Update.
	(init_error): Don't set hook.
f:
	* com.c (lang_print_error_function): Rename.
	(LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
	(ffe_init): Don't set hook.
java:
	* lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
	(java_dummy_print): Remove.
	(lang_print_error): Rename.  Exit early if inhibiting output.
	(inhibit_error_printing_function): New.
	(java_init): Don't set hook.
	(lang_init_source): Use new boolean.

From-SVN: r51672
2002-03-31 22:32:05 +00:00
Neil Booth 7afff7cfb0 Makefile.in: Update.
* Makefile.in: Update.
	* c-common.c: Include langhooks.h.
	(inline_forbidden_p): Use new hook.
	* diagnostic.c: Include langhooks.h.
	(format_with_decl, announce_function,
	default_print_error_function): Use new hook.
	* dwarf2out.c (dwarf2_name): Use new hook.
	* function.c: Include langhooks.h.
	(init_function_start): Use new hook.
	* langhooks-def.h (lhd_decl_printable_name): New.
	(LANGHOOKS_DECL_PRINTABLE_NAME): New.
	(LANGHOOKS_INITIALIZER): Update.
	* langhooks.c (lhd_decl_printable_name): New.
	* langhooks.h (struct lang_hooks): New hook.
	* toplev.c (decl_name, decl_printable_name): Remove.
	(open_dump_file): Use new hook.
	(process_options): Remove old hook.
	* tree.h (decl_printable_name): Remove.
ada:
	* misc.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(gnat_init): Remove old hook.
cp:
	* cp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	* cp-tree.h (lang_printable_name): Rename.
	* error.c (lang_decl_name): Use new hook.
	* lex.c (cxx_init): Remove old hook.
	* pt.c (tsubst_expr): Use new hook.
	* tree.c (lang_printable_name): Rename.
f:
	* com.c (lang_printable_name): Rename.
	(LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(ffe_init): Don't use old hook.
java:
	* decl.c (start_java_method): Use new hook.
	* lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.
	(java_init): Remove old hook.
objc:
	* objc-act.c (objc_init): Remove old hook.
	(objc_printable_name): Export.
	* objc-act.h (objc_printable_name): New.
	* objc-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine.

From-SVN: r51066
2002-03-20 07:58:41 +00:00
Zack Weinberg a63bea75b1 diagnostic.c (internal_error): Do ICE suppression only when ENABLE_CHECKING is not defined.
* diagnostic.c (internal_error): Do ICE suppression only
	when ENABLE_CHECKING is not defined.

From-SVN: r49151
2002-01-23 19:34:08 +00:00
Richard Kenner 93efb9de8c Properly indent two lines.
From-SVN: r49043
2002-01-21 07:35:58 -05:00
Richard Kenner bb93b973c9 diagnostic.c (warn_deprecated_use): Rework to lower indentation.
* diagnostic.c (warn_deprecated_use): Rework to lower indentation.
	* expr.c (emit_move_insn_1): Remove warning, use HOST_WIDE_INT for
	offsets, and change line folding.
	* optabs.c (expand_binop): Remove warnings.
	* sdbout.c (sdbout_record_type_name): Constify NAME to avoid warning.

From-SVN: r48801
2002-01-12 09:05:32 -05:00
Graham Stott f9f6b7df9d attribs.c (handle_deprecated_attribute): constify WHAT.
* attribs.c (handle_deprecated_attribute): constify WHAT.
        * diagnostic.c (warn_deprecated_use): Add braces, fixes
        dangling else warning and constify WHAT.
        * except.h (struct function, struct inline_remap): Move
        struct tag forward defs before all prototypes.
        (duplicate_eh_regions): Whitespace.

From-SVN: r48799
2002-01-12 13:45:39 +00:00
Ira Ruben e23bd2185f Added __attribute__((deprecated)) patches.
From-SVN: r48743
2002-01-10 18:51:24 +00:00
Kazu Hirata 173bf5be74 c-common.c: Fix formatting.
* c-common.c: Fix formatting.
	* diagnostic.c: Likewise.
	* doloop.c: Likewise.
	* dwarf2out.c: Likewise.

From-SVN: r48526
2002-01-04 02:00:26 +00:00
Jason Merrill 4ff8507ec5 diagnostic.c (sorry): Increment sorrycount before saving the buffer state.
* diagnostic.c (sorry): Increment sorrycount before saving the
        buffer state.

From-SVN: r48005
2001-12-14 15:13:55 -05:00
Joseph Myers a1f300c0f1 ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.2, ChangeLog.3, ChangeLog.4, ChangeLog,
	FSFChangeLog.10, c-decl.c, cppfiles.c, cppinit.c, cpplex.c,
	cpplib.c, cppmain.c, cse.c, df.c, diagnostic.c, dominance.c,
	dwarf2out.c, dwarfout.c, emit-rtl.c, errors.c, except.c, except.h,
	explow.c, function.c, gcse.c, genrecog.c, predict.c, regmove.c,
	sched-rgn.c, ssa-ccp.c, stmt.c, toplev.c: Fix spelling errors.

From-SVN: r47279
2001-11-23 02:05:19 +00:00
Kaveh R. Ghazi 83182544db c-parse.in (yyerror): Const-ification and/or static-ization.
* c-parse.in (yyerror): Const-ification and/or static-ization.
	* c-typeck.c (push_member_name): Likewise.
	* collect2.c (main): Likewise.
	* dbxout.c (dbxout_parms): Likewise.
	* diagnostic.c (format_with_decl): Likewise.
	* dwarf2out.c (output_ranges): Likewise.
	* dwarfout.c (fundamental_type_code): Likewise.
	* except.c (dw2_output_call_site_table): Likewise.
	* gcc.c (do_spec_1): Likewise.
	* genopinit.c (optabs): Likewise.
	* objc/objc-act.c (synth_id_with_class_suffix, start_class,
	gen_declaration_1, handle_impent): Likewise.
	* protoize.c (default_include, in_system_include_dir, abspath):
	Likewise.
	* sched-vis.c (visualize_stall_cycles): Likewise.
	* sdbout.c (plain_type_1, sdbout_end_function,
	sdbout_end_epilogue): Likewise.
	* varasm.c (decode_reg_name): Likewise.

	* 1750a.c (mod_regno_adjust): Likewise.
	* alpha.c (alpha_write_one_linkage,
	unicosmk_output_default_externs): Likewise.
	* arm.c (arm_condition_codes): Likewise.
	* arm.h (arm_condition_codes): Likewise.
	* avr.c (output_movsisf, encode_section_info): Likewise.
	* darwin.h (GEN_BINDER_NAME_FOR_STUB, GEN_SYMBOL_NAME_FOR_SYMBOL):
	Likewise.
	* i386.c (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* i386.h (hi_reg_name, qi_reg_name, qi_high_reg_name): Likewise.
	* m88k.c (output_function_profiler): Likewise.
	* mips.c (mips_output_conditional_branch): Likewise.
	* ns32k.c (ns32k_out_reg_names): Likewise.
	* ns32k.h (ns32k_out_reg_names): Likewise.
	* pj.c (pj_output_rval): Likewise.
	* rs6000.c (GEN_LOCAL_LABEL_FOR_SYMBOL): Likewise.
	* sparc.c (sparc_flat_function_prologue,
	sparc_flat_function_epilogue): Likewise.

cp:
	* decl.c (warn_extern_redeclared_static, cp_make_fname_decl):
	Const-ification.
	* pt.c (tsubst_decl): Likewise.

f:
	* bad.c (ffebad_finish): Const-ification and/or static-ization.
	* intrin.c (ffeintrin_cmp_name_): Likewise.
	* stc.c (ffestc_R904): Likewise.

java:
	* expr.c (expand_invoke): Const-ification.
	* parse.y (patch_method_invocation): Likewise.

From-SVN: r45581
2001-09-13 14:37:29 +00:00
Andreas Jaeger 79e8ec0eb2 (forgot in last checkin)
Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.

From-SVN: r45223
2001-08-28 06:55:48 +02:00
Lars Brinkhoff 1322177dbd Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
	bitmap.h, builtin-types.def, builtins.c, builtins.def,
	c-aux-info.c, c-common.c, c-common.def, c-common.h,
	c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
	c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
	c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
	caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
	conditions.h, config.gcc, configure.frag, configure.in,
	conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
	cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
	dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
	doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
	dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
	emit-rtl.c, errors.c, errors.h, except.c, except.h,
	exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
	fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
	function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
	gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
	gencheck.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, gengenrtl.c, genmultilib,
	genopinit.c, genoutput.c, genpeep.c, genrecog.c,
	gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
	ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
	graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
	gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
	gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
	hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
	integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
	libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
	machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
	mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
	mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
	params.h, predict.c, predict.def, predict.h, prefix.c,
	prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
	read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
	regclass.c, regmove.c, regrename.c, regs.h, reload.c,
	reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
	rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
	sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
	sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
	ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
	stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
	tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
	tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
	unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
	unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
	xcoffout.h: replace "GNU CC" with "GCC".

From-SVN: r45105
2001-08-22 14:35:51 +00:00
Zack Weinberg d9b6874b0c final.c (shorten_branches): Clear the end of the label_align array only if we made it larger.
* final.c (shorten_branches): Clear the end of the label_align
	array only if we made it larger.  Break up messy expressions
	for clarity.

	* diagnostic.c (internal_error): Check for error recursion
	before doing ICE suppression.

	* timevar.c: Timing variables now count in milliseconds.
	(init_timevar): Set up ticks_to_msec and clocks_to_msec here.
	(get_time): Not here.
	(timevar_print): Don't print any timer whose user, cpu, and
	wall times are all zero as displayed.
	* timevar.h: Update comment aboout units.  Make timevar
	counters unsigned.

From-SVN: r44948
2001-08-17 01:27:49 +00:00
Gabriel Dos Reis c895acf211 Makefile.in (OBJS): Add rtl-error.o
* Makefile.in (OBJS): Add rtl-error.o
	(rtl-error.o): New rule.
	(diagnostic.o): Adjust dependency.
	diagnostic.c (file_and_line_for_asm, diagnostic_for_asm,
	error_for_asm, _fatal_insn, _fatal_insn_not_found,
	warning_for_asm): Move to...
	rtl-error.c: ...here.  New file.

From-SVN: r44894
2001-08-14 19:22:48 +00:00
Kazu Hirata 30f7a3786c dbxout.c: Fix comment formatting.
* dbxout.c: Fix comment formatting.
	* dependence.c: Likewise.
	* df.c: Likewise.
	* diagnostic.c: Likewise.
	* dominance.c: Likewise.
	* doprint.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarfout.c: Likewise.
	* emit-rtl.c: Likewise.
	* except.c: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.

From-SVN: r44729
2001-08-08 22:06:48 +00:00
Gabriel Dos Reis 64dfaa76b3 diagnostic.c (finish_diagnostic): Rename to diagnostic_finish.
* diagnostic.c (finish_diagnostic): Rename to
        diagnostic_finish. Make it take an 'output_buffer *'.  Adjust
        calls thourghout.

From-SVN: r43905
2001-07-10 16:04:55 +00:00
Gabriel Dos Reis 46f018e138 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
2001-06-28 12:26:38 +00:00
Gabriel Dos Reis 6b67c26e61 diagnostic.h: Add documentation.
2001-06-27  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.h: Add documentation. Make macros polymorphic.
	* diagnostic.c (ideal_line_wrap_cutoff): Remove
	definition. Replace with diagnostic_line_cutoff.
	(prefixing_policy): Remove. Replace with diagnostic_prefixing_rule.

From-SVN: r43616
2001-06-27 18:03:03 +00:00
Gabriel Dos Reis 9596ddd67e toplev.c (decode_f_option): Adjust setting.
* toplev.c (decode_f_option): Adjust setting.
	(toplev_main): Call diagnostic_initialize.  Remove call to
	reshape_diagnostic_buffer._

	* diagnostic.h (struct output_buffer): Add new field format_decoder.
	(diagnostic_format_decoder): New macro.
	(diagnostic_prefixing_rule): Likewise.
	(diagnostic_line_cutoff): Likewise.
	(set_message_prefixing_rule): Remove.

	* diagnostic.c (lang_printer): Remove.
	(diagnostic_message_length_per_line): Likewise.
	(current_prefixing_rule): Likewise.
	(initialize_diagnostics): Rename to...
	(diagnostic_initialize): ...this. Tweak.
	(default_initialize_buffer): Remove.
	(reshape_diagnostic_buffer): Likewise.
	(init_output_buffer): Adjust prefixing rule setting.
	(output_format): Use format_decoder from the output_buffer.

	* c-lang.c (c_init): Adjust tree formatter setting.

cp/
  	* error.c (init_error): Adjust settings.

From-SVN: r43588
2001-06-26 19:18:37 +00:00
Gabriel Dos Reis f68fc4db62 diagnostic.h (struct diagnostic_context): Add new field.
* diagnostic.h (struct diagnostic_context): Add new field.
	(lang_diagnostic_starter, lang_diagnostic_finalizer): Remove
	declaratons.
	(global_dc): Declare.
	* diagnostic.c (global_diagnostic_context): New variable.
	(global_output_buffer): Remove.
	(global_dc): Define.
	(lang_diagnostic_starter, lang_diagnostic_finalizer): Remove
 	definitions.
	(initialize_diagnostics): Adjust initialization.
	(set_diagnostic_context): Adjust setting.

cp/

	* error.c (init_error): Adjust settings.

From-SVN: r43581
2001-06-26 14:06:07 +00:00
Gabriel Dos Reis 0deaa8136a diagnostic.h (diagnostic_prefixing_rule_t): New enum type.
* diagnostic.h (diagnostic_prefixing_rule_t): New enum type.
	(set_message_prefixing_rule): Adjust prototype.
	* diagnostic.c (current_prefixing_rule): Adjust type.

From-SVN: r43573
2001-06-26 07:53:50 +00:00
Gabriel Dos Reis 255fcfbb81 diagnostic.c (digit_buffer): Remove as global.
* diagnostic.c (digit_buffer): Remove as global.  Move to...
	* diagnostic.h (struct output_buffer): ... here.
	* diagnostic.c (output_formatted_integer): Adjust use of digit_buffer.

From-SVN: r43567
2001-06-26 05:42:06 +00:00
Gabriel Dos Reis 2a2b2d432e 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
2001-06-10 13:48:04 +00:00
Zack Weinberg 1f8875f91d diagnostic.c (vnotice): Kill.
2001-05-23  Zack Weinberg  <zackw@stanford.edu>

	* diagnostic.c (vnotice): Kill.
	(fnotice): Call vfprintf directly.
	(diagnostic_for_decl, output_do_verbatim, output_verbatim,
	verbatim, set_diagnostic_context): Rename string argument to
	indicate that it is run through gettext.
	(vbuild_message_string, build_message_string, output_do_printf):
	Rename string argument to indicate that it is NOT run through
	gettext.
	(output_printf, diagnostic_for_decl, fatal_io_error, sorry,
	output_do_verbatim, set_diagnostic_context, fnotice, _fatal_insn):
	Run msgid argument through gettext.
	(default_print_error_function): Run constant strings through
	gettext when nothing else will.
	(fatal_error, internal_error, error_recursion): Use fnotice.
	Present complete sentences to gettext.

From-SVN: r42498
2001-05-23 17:15:07 +00:00
Richard Henderson 5e7f4a4ab9 mkconfig.sh: Include insn-flags.h.
* mkconfig.sh: Include insn-flags.h.
	* Makefile.in (CONFIG_H): Include insn-flags.h.
	(lots of objects): Remove insn-codes.h and insn-flags.h.

	* alias.c, bb-reorder.c, calls.c, do-loop.c, flow.c, haifa-sched.c,
	integrate.c, jump.c, loop.c, predict.c, profile.c, reg-stack.c,
	regmove.c, reorg.c, a29k/a29k.c, alpha/alpha.c, arc/arc.c, arm/arm.c,
	avr/avr.c, clipper/clipper.c, convex/convex.c, d30v/d30v.c,
	dsp16xx/dsp16xx.c, fr30/fr30.c, h8300/h8300.c, i370/i370.c,
	i386/i386.c, i860/i860.c, ia64/ia64.c, m32r/m32r.c, m68hc11/m68hc11.c,
	m68k/m68k.c, m88k/m88k.c, mcore/mcore.c, mn10200/mn10200.c,
	mn10300/mn10300.c, ns32k/ns32k.c, pa/pa.c, pdp11/pdp11.c,
	pj/pj.c, romp/romp.c, rs6000/rs6000.c, sh/sh.c, sparc/sparc.c,
	v850/v850.c, vax/vax.c:
	Don't include insn-flags.h.

	* diagnostic.c, expr.h, reload.c, toplev.c:
	Don't include insn-codes.h.

	* builtins.c, combine.c, except.c, explow.c, expmed.c, expr.c,
	final.c, function.c, optabs.c, recog.c, reload1.c, stmt.c,
	c4x/c4x.c, i960/i960.c, mips/mips.c:
	Don't include insn-codes.h or insn-flags.h.

	* genemit.c, genopinit.c, genoutput.c: Don't include insn-codes.h
	or insn-flags.h in the generated code.
	* genflags.c (gen_proto): Use "struct rtx_def *" instead of "rtx".
	(main): Forward declare struct rtx_def.

From-SVN: r40754
2001-03-22 10:48:52 -08:00
Richard Kenner fce687f876 diagnostic.c (trim_filename): No longer static.
* diagnostic.c (trim_filename): No longer static.
	* toplev.h (trim_filename): Declare.
	* rtl.c (rtl_check_failed_bounds): Call internal_error.
	(rtl_check_failed_type1, rtl_check_failed_type2): Likewise.
	(rtl_check_failed_code1, rtl_check_failed_code2): Likewise.
	(rtvec_check_failed_bounds): Likewise.
	* tree.c (tree_check_failed, tree_class_check_failed): Likewise.

From-SVN: r40016
2001-02-23 16:17:06 -05:00
Gabriel Dos Reis 3d7c9b7e5b diagnostic.c (output_to_stream): Rename to output_buffer_to_stream.
* diagnostic.c (output_to_stream): Rename to
	output_buffer_to_stream. Loses the stream parameter.
	(init_output_buffer): Set diagnosic_buffer's stream.
	(flush_diagnostic_buffer): Adjust.
	(default_print_error_function): Likewise.
	(finish_diagnostic): Likewise.
	(verbatim): Likewise.

	* diagnostic.h (struct output_buffer): Add `stream' field.
	(output_buffer_attached_stream): New macro.

From-SVN: r39999
2001-02-23 17:28:25 +00:00
Richard Kenner e28a09a451 * diagnostic.c (_fatal_insn): Decrement errorcount.
From-SVN: r39834
2001-02-18 10:17:36 -05:00
Jason Merrill 33c4f1746c diagnostic.c (internal_error): Say "confused" after 1 error, not two.
* diagnostic.c (internal_error): Say "confused" after 1 error, not
        two.  Print file and line with "confused" message.

From-SVN: r39543
2001-02-08 12:18:47 -05:00
Richard Kenner 400500c4a5 diagnostic.h (set_internal_error_function): Renamed.
* diagnostic.h (set_internal_error_function): Renamed.
	* toplev.h (internal_error): Renamed from fatal.
	(pfatal_with_name): Deleted.
	(fatal_io_error): Now has printf-style arguments.
	* diagnostic.c (pfatal_with_name): Deleted.
	(fatal_io_error): Rework to have args in printf-style.
	(set_internal_error_function): Renamed from set_fatal_function.
	(internal_error): Renamed from fatal.
	(error_recursion, fancy_abort): Call internal_error instead of fatal.
	* dwarf2out.c (get_cfa_from_loc_descr): Likewise.
	* emit-rtl.c (gen_realpart, gen_imagpart): Likewise.
	* expr.c (check_max_integer_computation_mode, expand_expr): Likewise.
	* flow.c (verify_flow_info): Likewise.
	* config/arm/arm.c (thumb_unexpanded_epilogue): Likewise.
	* config/mips/mips.c (save_restore_insns): Likewise.
	* cp/init.c (build_java_class_ref): Likewise.
	(dsp16xx_reg_class_from_letter): Likewise.
	(limit_reload_class, double_reg_to_memory): Likewise.
	(print_operand_address, emit_1600_code_shift): Likewise.
	(gen_tst_reg, gen_compare_reg): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
	* cp/decl.c (pushdecl): Likewise.
	* java/check-init.c (check_init): Likewise.
	* java/expr.c (java_lang_expand_expr): Likewise.
	* java/jcf-parse.c (get_constant): Likewise.
	* java/mangle.c (java_mangle_decl): Likewise.
	* java/parse.y (make_nested_class_name, java_complete_lhs): Likewise.
	(operator_string): Likewise.

	* except.c (duplicate_eh_handlers): Call abort instead of fatal.
	* flow.c (verify_flow_info): Likewise.
	* ch/convert.c (convert): Likewise.
	* ch/except.c (pop_handler, chill_check_no_handlers): Likewise.
	* ch/expr.c (chill_expand_expr): Likewise.
	* ch/parse.c (peek_token_, pushback_token, require): Likewise.
	* config/arm/arm.c (thumb_load_double_from_address): Likewise.
	* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
	(avr_normalize_condition): Likewise.
	* config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise.
	* config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise.
	(limit_reload_class, double_reg_to_memory): Likewise.
	(print_operand_address, emit_1600_code_shift): Likewise.
	(gen_tst_reg, gen_compare_reg): Likewise.
	* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
	* cp/decl.c (pushdecl): Likewise.
	* java/check-init.c (check_init): Likewise.
	* java/class.c (build_class_ref): Likewise.
	* java/constants.c (write_constant_pool): Likewise.
	* java/decl.c (start_java_method): Likewise.
	* java/expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
	(java_stack_dup, encode_newarray_type): Likewise.
	(build_java_array_length_access): Likewise.
	(build_java_check_indexed_type, expand_java_pushc): Likewise.
	(build_java_soft_divmod, build_invokeinterface): Likewise.
	* java/java-tree.h (INNER_CLASS_P): Likewise.
	* java/jcf-parse.c (parse_signature, get_name_constant): Likewise.
	(give_name_to_class, get_class_constant): Likewise.
	* java/jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
	(find_constant_index, generate_bytecode_conditional): Likewise.
	(generate_bytecode_insns, perform_relocations): Likewise.
	* java/lex.c (java_unget_unicode, java_lex): Likewise.
	* java/mangle.c (mangle_type, mangle_record_type): Likewise.
	(mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
	(finish_mangling): Likewise.
	* java/parse.h (MARK_FINAL_PARMS): Likewise.
	* java/parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
	(obtain_incomplete_type, java_complete_class): Likewise.
	(java_check_regular_methods, java_complete_expand_method): Likewise.
	(cut_identifier_in_qualified, check_deprecation): Likewise.
	(patch_invoke, find_applicable_accessible_methods_list): Likewise.
	(java_complete_lhs, lookup_name_in_blocks): Likewise.
	(check_final_variable_indirect_assignment, build_unaryop): Likewise.
	* java/typeck.c (set_local_type, parse_signature_type): Likewise.
	(parse_signature_string, build_java_signature): Likewise;
	(set_java_signature): Likewise.
	* java/verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.

	* c-parse.in (methoddef): Call fatal_error instead of fatal.
	* objc/objc-act.c (build_ivar_chain): Likewise.
	* cp/except.c (decl_is_java_type): Likewise.
	* cp/init.c (build_java_class_ref): Likewise.
	* cp/init.c (build_new_1): Likewise.
	* f/com.c (ffecom_init_0): Likewise.
	* java/class.c (add_method, build_static_field_ref): Likewise.
	* java/expr.c (build_known_method_ref, expand_invoke): Likewise.
	* java/jcf-parse.c (get_constant, jcf_parse): Likewise.
	* java/lex.c (java_new_new_lexer): Likewise.
	* java/jv-scan.c (main): Likewise.
	(fatal_error): Renamed from fatal.

	* dwarfout.c (dwarfout_init): Call fatal_io_error instead of
	pfatal_with_name.
	* graph.c (clean_graph_dump_file): Likewise.
	* profile.c (init_branch_prob): Likewise.
	* ch/grant.c (write_grant_file): Likewise.
	* ch/lex.c (init_parse, same_file, yywrap): Likewise.
	* f/com.c (init_parse): Likewise.
	* java/jcf-parse.c (yyparse): Likewise.
	* objc/objc-act.c (objc_init): Likewise.

	* java/jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
	(yyparse): Likewise.
	* java/jcf-write.c (make_class_file_name, write_classfile): Likewise.
	* java/lex.c (java_get_line_col): Likewise.

	* hash.c (hash_allocate): Don't check for failure returns from
	obstack functions that can't fail.
	(hash_table_init_n, hash_table_init): Likewise; also now return void.
	* hash.h (hash_table_init_n, hash_table_init): Now return void.
	* cp/decl.c (build_typename_type): hash_table_init now returns void.

	* ch/lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
	* ch/lex.c (convert_bitstring): Delete check for alloca failure.
	* config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare):
	Deleted.
	* config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it.

	* f/com.c (ffecom_decode_include_option_): Make errors non-fatal.
	* f/lex.c (ffelex_cfelex_, ffelex_get_directive_line_): Likewise.
	(ffelex_hash_): Likewise.
	* config/arm/arm.c (arm_override_options): Likewise.
	* config/avr/avr.c (avr_override_options): Likewise.
	* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
	* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
	* config/h8300/h8300.c (h8300_init_once): Likewise.
	* config/mips/mips.c (override_options): Likewise.
	* config/i386/i386.c (override_options): Likewise, rework.
	* config/m68k/m68k.c (override_options): Likewise.
	* cp/decl.c (init_decl_processing): Likewise.
	* java/jcf-parse.c (load_class): Likewise.

	* config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage
	instead of fatal.
	* config/mips/mips.c (print_operand): Likewise.

	* java/lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
	* objc/objc_act.c (objc_check_decl): Remove unneeded fatal call.
	(get_object_reference): Likewise.

From-SVN: r39443
2001-02-04 17:44:12 -05:00
Neil Booth bdda33259f * diagnostic.c (fatal): Fix word wrap.
From-SVN: r39356
2001-01-30 23:47:33 +00:00
Neil Booth 7fa531a6eb * diagnostic.c (fatal): Request preprocessed source.
From-SVN: r39258
2001-01-25 07:39:50 +00:00
Richard Kenner 43db5b3c2c diagnostic.c (finish_abort): Deleted.
Sat Dec 16 10:41:11 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* diagnostic.c (finish_abort): Deleted.
	(fatal): Add code from fninish_abort.
	(error_recursion, fancy_abort): Call fatal, not finish_abort.
	(trim_filename): Remove leading "../".
	* diagnostic.h (finish_abort): Deleted.
	* toplev.c (crash_signal): Call fatal, not finish_abort.

	* stor-layout.c (place_field): Treat overflowing DECL_SIZE_UNIT
	as if size were variable.

	* expmed.c (expand_mult): Write REG_EQUAL note with proper mode.

From-SVN: r38309
2000-12-16 11:23:46 -05:00
Jason Merrill 62c0790555 stor-layout.c (int_mode_for_mode): Handle MODE_VECTOR_INT, MODE_VECTOR_FLOAT.
* stor-layout.c (int_mode_for_mode): Handle MODE_VECTOR_INT,
        MODE_VECTOR_FLOAT.

        * diagnostic.c (report_problematic_module): s/function/module/.

        * c-lex.h: Remove decl for check_newline.

From-SVN: r38003
2000-12-04 12:14:16 -05:00
Phil Edwards c4765d18f2 diagnostic.c: Fix typos in comments.
2000-12-01  Phil Edwards  <pme@sources.redhat.com>

	* diagnostic.c:  Fix typos in comments.
	* diagnostic.h:  Likewise.

From-SVN: r37923
2000-12-01 19:31:01 +00:00
Zack Weinberg 520a57c81c stringpool.c: New file.
* stringpool.c: New file.
	* ggc-common.c (ggc_mark_string_ptr, ggc_add_string_root): Delete.
	(ggc_alloc_string): Now in stringpool.o.
	* ggc-page.c, ggc-simple.c: Do not define or allocate empty_string.
	* ggc.h: Delete prototype of ggc_add_string_root.  #define
	ggc_add_string_root and ggc_mark_string to nothing.  Prototype
	init_stringpool and stringpool_statistics.
	(ggc_alloc_string): Returns a const char *.
	* tree.c (hash_table, do_identifier_warnings): Delete.
	(init_obstacks): Don't initialize the identifier hash table.
	(get_identifier, maybe_get_identifier, start_identifier_warnings,
	set_identifier_size): Now in stringpool.c.
	* tree.h (struct tree_string): Constify pointer field.
	(approx_sqrt): Prototype.

	* Makefile.in (stringpool.o): Add rule, mention in OBJS.

	* toplev.c (approx_sqrt): New function.
	(compile_file): Call stringpool_statistics if mem_report is on.
	(main): Call init_stringpool.

	* builtins.c (c_strlen), c-decl.c (finish_decl), c-lex.c
	(process_directive), c-typeck.c (constructor_asmspec, struct
	initializer_stack, start_init), except.c (create_rethrow_ref),
	stmt.c (digit_strings), toplev.c (decode_f_option), tree.c
	(built_in_filename), varasm,c (in_named_name,
	assemble_static_space, struct constant_descriptor, struct
	deferred_string, struct pool_constant, force_const_mem),
	i386.c (pic_label_name, global_offset_table_name), rs6000.c
	(rs6000_emit_prologue, rs6000_emit_epilogue) : Constify a char *.

	* c-common.c (combine_strings): Combine strings in scratch
	buffer, then pass to build_string.
	* optabs.c (init_libfuncs), profile.c (init_edge_profiler,
	output_func_start_profiler), stmt.c (init_stmt), alpha.c
	(alpha_need_linkage), arm.c (arm_encode_call_attribute),
	i386.c (load_pic_register), ia64.c (ia64_encode_section_info),
	rs6000.c (rs6000_encode_section_info): Create string in
	scratch buffer, then pass to ggc_alloc_string.

	* stmt.c (expand_asm_operands): If we must adjust the
	constraint strings, do so by creating a new one, not by
	modifying the old one in place.  Constify some char *s.
	* config/pa/pa.c (hppa_encode_label): Drop unnecessary second
	argument.  Create string in scratch buffer, then pass to
	ggc_alloc_string.
	* config/pa/pa-protos.h: Update prototype.
	* config/pa/elf.h, config/pa/pa.h, config/pa/som.h:
	hppa_encode_label takes only one argument.

	* c-parse.in (if_prefix): Find the filename and line number at
	$-2 and $-1 respectively.
	* diagnostic.c (error_recursion): Add missing newline, use
	fputs, translate string.

cp:
	* lex.c (struct impl_files, internal_filename): Constify a char *.
java:
	* jcf-parse.c (get_constant), parse.y (do_merge_string_cste):
	Create string in scratch buffer, then pass to build_string.

From-SVN: r37514
2000-11-17 06:05:31 +00:00
Jason Merrill ee3400e881 diagnostic.c (finish_abort): New fn.
* diagnostic.c (finish_abort): New fn.
        (fancy_abort, error_recursion): Use it.
        * toplev.c (crash_signal): Likewise.
        * diagnostic.h: Declare it.

        * typeck2.c (friendly_abort): Uncount the error before handing
        off to fancy_abort.

From-SVN: r37480
2000-11-15 10:50:51 -05:00
Joseph Myers 88f3c47786 diagnostic.c (vbuild_message_string, [...]): Add ATTRIBUTE_PRINTF.
* diagnostic.c (vbuild_message_string, output_do_printf, vnotice):
	Add ATTRIBUTE_PRINTF.
	* tradcpp.c (v_message, warning, error, fatal, error_with_line):
	Add ATTRIBUTE_PRINTF*.

java:
	* parse.y (issue_warning_error_from_context): Add
	ATTRIBUTE_PRINTF.

From-SVN: r37419
2000-11-13 13:23:37 +00:00
Joseph Myers 961192e1dd alias.c [...] (init_alias_analysis, [...]): Use memset () instead of bzero ().
* alias.c (init_alias_analysis), calls.c (expand_call,
	emit_library_call_value_1), combine.c (init_reg_last_arrays),
	cse.c (new_basic_block), dbxout.c (dbxout_type), diagnostic.c
	(init_output_buffer, set_diagnostic_context), dwarf2out.c
	(equate_decl_number_to_die, build_abbrev_table), emit-rtl.c
	(init_emit_once), fold-const.c (mul_double, div_and_round_double),
	function.c (assign_parms), gcse.c (compute_can_copy,
	alloc_gcse_mem, alloc_reg_set_mem, record_one_set,
	compute_hash_table, compute_set_hash_table,
	compute_expr_hash_table), genattrtab.c (optimize_attrs), global.c
	(global_alloc, global_conflicts), haifa-sched.c (compute_trg_info,
	clear_units, schedule_block), integrate.c (initialize_for_inline,
	expand_inline_function), jump.c (thread_jumps), local-alloc.c
	(local_alloc), loop.c (combine_movables, count_loop_regs_set,
	load_mems_and_recount_loop_regs_set), print-tree.c (debug_tree),
	regclass.c (init_reg_sets, init_reg_sets_1, regclass,
	record_reg_classes, allocate_reg_info), reload.c
	(get_secondary_mem, remove_address_replacements, find_reloads),
	reload1.c (reload, set_initial_label_offsets, finish_spills,
	reload_as_needed, choose_reload_regs_init,
	reload_cse_simplify_operands), reorg.c (dbr_schedule), sbitmap.c
	(sbitmap_zero), simplify-rtx.c (simplify_plus_minus), ssa.c
	(rename_registers), stmt.c (expand_end_case), unroll.c
	(unroll_loop), varray.c (varray_grow), objc/objc-act.c: Use memset
	() instead of bzero ().

ch:
	* actions.c (check_missing_cases), typeck.c (build_chill_slice,
	build_chill_cast): Use memset () instead of bzero ().

cp:
	* class.c (duplicate_tag_error, build_vtbl_initializer), decl.c
	(push_binding_level), error.c (cp_tree_printer), pt.c
	(process_partial_specialization, tsubst_template_arg_vector),
	search.c (lookup_member): Use memset () instead of bzero ().

java:
	* expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
	(init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
	instead of bzero ().

From-SVN: r37303
2000-11-07 22:50:06 +00:00
Joseph Myers bf6eb15f68 diagnostic.c: Remove EGCS reference in comment.
* diagnostic.c: Remove EGCS reference in comment.

f:
	* Makefile.in, g77spec.c: Remove EGCS references in comments.

From-SVN: r36996
2000-10-21 19:10:32 +01:00
Richard Henderson 331fe257d6 * diagnostic.c (output_format): Add missing break.
From-SVN: r36739
2000-10-05 18:46:50 -07:00
Gabriel Dos Reis b5dd2c76f8 diagnostic.h (output_clear_message_text): New function.
* diagnostic.h (output_clear_message_text): New function.
	(output_message_text): New macro.

	* diagnostic.c (clear_text_info): Rename to
	output_clear_message_text.
	(output_clear): Adjust.
	(output_finish): Rename to output_finalize_message.  Tweek.
	(output_to_stream): Adjust.

From-SVN: r36658
2000-09-28 12:50:37 +00:00
Branko Cibej 317639a81c flags.h: Declare warning flag warn_system_headers.
2000-09-25  Branko Cibej  <branko.cibej@hermes.si>

        * flags.h:  Declare warning flag warn_system_headers.
        * toplev.c:  Define it.
        (W_options): Add option -Wsystem-headers.
        * diagnostic.c (count_error): Test warn_system_headers.
        * invoke.texi:  Add description for -Wsystem-headers.
	* cpplib.h (cpp_options): New member warn_system_headers.
	* cpphash.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Don't test
	CPP_IN_SYSTEM_HEADER.
	* cpplib.c (do_import, do_pragma_once): Likewise.
	* cpperror.c (_cpp_begin_message): Test warn_system_headers
	and CPP_IN_SYSTEM_HEADER.
	* cppinit.c (handle_option): Recognize -Wsystem_headers.
	(print_help): Describe -Wsystem_headers.
	* cpplex.c (lex_line): Reorganize condition so that warnings
	about C++ comments in system headers can be enabled. Remove
	label do_line_comment.

From-SVN: r36636
2000-09-25 22:54:04 +00:00
Gabriel Dos Reis 4b40f7588e diagnostic.c (output_last_position): Define.
* diagnostic.c (output_last_position): Define.
	(set_real_maximum_length): Tweek.
	* diagnostic.h (output_last_position): Declare.

From-SVN: r36629
2000-09-25 21:20:19 +00:00
Gabriel Dos Reis e651302389 toplev.c (display_help): Fix thinko in documentation.
* toplev.c (display_help): Fix thinko in documentation.

	* diagnostic.h (output_buffer::indent_skip): New fields.
	(output_indentation): New macro.

	* diagnostic.c (output_indent): New function.
	(output_set_prefix, clear_diagnostic_info): Use.
	(output_emit_prefix): Predict future indentation.

From-SVN: r36205
2000-09-06 18:43:35 +00:00
Gabriel Dos Reis 2ab99c469c diagnostic.c (finish_diagnostic): Define.
* diagnostic.c (finish_diagnostic): Define.
	(output_do_printf): Use wrap_text instead of output_add_string.
	(default_print_error_function): Avoid embedded '\n'.

	* diagnostic.h (flush_diagnostic_buffer): Declare.

cp/
	* error.c (print_instantiation_context): Don't forget to flush the
	buffer.

From-SVN: r35939
2000-08-24 08:30:02 +00:00
Gabriel Dos Reis f6a542dece diagnostic.h (output_buffer_state): New macro.
* diagnostic.h (output_buffer_state): New macro.
	* diagnostic.c (diagnostic_for_decl, sorry,
	default_print_error_function, output_do_verbatim,
	report_diagnostic, report_problematic_module): Use it.
	(wrap_text): Tweak.
	(output_format): Use wrap_text instead of maybe_wrap_text.

From-SVN: r35891
2000-08-22 20:20:32 +00:00
Gabriel Dos Reis b413d64ded 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
2000-08-22 06:54:54 +00:00
Gabriel Dos Reis 24805e803b diagnostic.c (context_as_prefix): Export.
* diagnostic.c (context_as_prefix): Export.
	(need_error_newline): Remove.
	(lang_diagnostic_starter, lang_diagnostic_finalizer): New objects.
	(error_module_changed, record_last_error_module,
	error_function_changed, record_last_error_function): New functions.
	(initialize_diagnostics): Default intialize
	lang_diagnostic_starter, lang_diagnostic_finalizer.
	(init_output_buffer): Tweak.
	(file_name_as_prefix): New function.
	(announce_function, default_print_error_function,
	report_error_function, set_diagnostic_context): Tweak.

cp/
	* lex.c (lang_init_options): Default diagnostic message maximum
	length to 80, when line-wrapping.

From-SVN: r35836
2000-08-21 10:14:18 +00:00
Gabriel Dos Reis e2840263c7 c-errors.c (pedwarn_c99): Adjust call to report_diagnostic.
* c-errors.c (pedwarn_c99): Adjust call to report_diagnostic.

	* diagnostic.c (default_diagnostic_starter,
	default_diagnostic_finalizer): New functions.
	(diagnostic_for_asm, diagnostic_for_decl): Tweak.
	(pedwarn, pedwarn_with_file_and_line, error,
	error_with_file_and_line, fatal, warning,
	warning_with_file_and_line): Adjust call to report_diagnostic.
	(report_diagnostic): Rework.
	(set_diagnostic_context): New function.

	* diagnostic.h (struct diagnostic_context): New data structure.
	(diagnostic_message, diagnostic_argument_list,
	diagnostic_file_location, diagnostic_line_location,
	diagnostic_is_warning, diagnostic_starter, diagnostic_finalizer,
	diagnostic_finalizer, diagnostic_auxiliary_data): New macros.
	(set_diagnostic_context): Declare.
	(report_diagnostic): Change prototype.

From-SVN: r35817
2000-08-20 09:50:12 +00:00
Richard Kenner 43b45e9412 diagnostic.c (fatal_function): New variable.
* diagnostic.c (fatal_function): New variable.
	(set_fatal_function): New function.
	(fatal): Call it.
	* diagnostic.h (set_fatal_function): New declaration.

From-SVN: r35731
2000-08-15 17:21:12 -04:00
Jeffrey Oldham 4eb00163ad collect2.c (main): Typo fixed.
2000-07-22  Jeffrey Oldham  <oldham@codesourcery.com>

	* collect2.c (main): Typo fixed.
	* diagnostic.c: Typo fixed.
	* dwarf2out.c (dwarf2out_frame_debug_expr): Typo fixed.
	* eh-common.h: Typo fixed.
	* emit-rtl.c (start_sequence): Typo fixed.
	* flow.c (find_label_refs): Typo fixed.
	(calculate_global_regs_live): Typo fixed.
	(mark_regno_cond_dead): Typo fixed.
	(create_edge_list): Typos fixed.
	(verify_edge_list): Typo fixed.
	* ggc-common.c (ggc_mark_rtx_children): Typo fixed.
	* loop.c (strength_reduce): Typo in function name fixed.
	* rtl.h: Added comments.  Typo in function name fixed.
	* rtlanal.c: Typo in function name fixed.
	(insn_dependant_p): Rename to ...
	(insn_dependent_p): ... this.
	(computed_jumo_p): Typo fixed.

From-SVN: r35194
2000-07-22 23:29:14 +00:00
Zack Weinberg fbfc11925b diagnostic.c (trim_filename, [...]): Moved here from rtl.c.
* diagnostic.c (trim_filename, fancy_abort): Moved here from
	rtl.c.
	(fatal_function, set_fatal_function): Removed.
	(fatal): Don't prepare for or call the fatal_function.
	(diagnostic_lock, error_recursion): New.
	(diagnostic_for_decl, report_diagnostic): Guard against
	re-entering the error reporting routines.
	(fancy_abort): Assume function is not NULL.

	* errors.c (fancy_abort): New.  Assume function is not NULL.
	* tradcpp.c (fancy_abort): Assume function is not NULL.

	* system.h: Provide default definition of __FUNCTION__.
	* rtl.h: Use __FUNCTION__ not __PRETTY_FUNCTION__ throughout.
	Always use __FUNCTION__ in definition of abort.
	* tree.h: Likewise.
	* varray.h: Likewise.
	* toplev.h: Likewise.  Don't prototype set_fatal_function.

From-SVN: r35170
2000-07-21 07:10:36 +00:00
Gabriel Dos Reis e81b4d6305 diagnostic.h (report_diagnostic): Change prototype.
2000-07-17  Gabriel Dos Reis  <gdr@codesourcery.com>

        * diagnostic.h (report_diagnostic): Change prototype.

        * diagnostic.c (output_do_verbatim, diagnostic_for_asm,
        diagnostic_for_decl):  Change prototype.
        (error_with_decl, warning_with_decl, pedwarn_with_decl, warning,
        error, warning, error_with_file_and_line,
        warning_with_file_and_line, pedwarn_with_file_and_line, fatal):
        Adjust call to report_diagnostic, diagnostic_for_decl.
        (error_for_asm, warning_for_asm): Adjust call to diagnostic_for_asm.
        (output_verbatim, verbatim): Adjust call to output_do_verbatim.

        * c-errors.c (pedwarn_c99): Adjust call to report_diagnostic. End
        varaible argument list.

From-SVN: r35116
2000-07-18 08:40:32 +00:00
Gabriel Dos Reis b27ca4d10b diagnostic.c (doing_line_wrapping, [...]): Remove.
2000-07-15  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.c (doing_line_wrapping, line_wrapper_printf, notice,
	v_error_with_decl, v_warning_with_decl, v_pedwarn_with_decl): Remove.
	(v_message_with_decl): Rename to ...
	(format_with_decl): ... this. Tweak
	(diagnostic_for_decl): New function.
	(fatal_io_error): Use verbatim in lieu of notice.
	(announce_function): Use verbatim.
	(default_print_error_function): Likewise.
	(error_with_decl, warning_with_decl, pedwarn_with_decl): Use new
	infratructure.

From-SVN: r35048
2000-07-15 16:50:31 +00:00
Gabriel Dos Reis c91ad6994f diagnostic.c (vline_wrapper_message_with_location, [...]): Remove.
2000-07-12  Gabriel Dos Reis  <gdr@codesourcery.com>

        * diagnostic.c (vline_wrapper_message_with_location,
        v_message_with_file_and_line, v_error_with_file_and_file,
        v_error_for_asm, v_warning_for_asm, vfatal,
        v_warning_with_file_and_line, v_pedwarn_with_file_and_line,
        vsorry, verror, vwarning, vpedwarn): Remove.
        (diagnostic_for_asm): New function.
        (pedwarn, error, warning, pedwarn_with_file_and_line,
        error_with_file_and_line, warning_with_file_and_line, sorry,
        error_for_asm, warning_for_asm, fatal): Reimplement.
        (finish_diagnostic): Clear diagnostic info as well.

From-SVN: r35011
2000-07-13 10:37:41 +00:00
Gabriel Dos Reis b9161f44f0 c-typeck.c (pedwarn_c99): Move to
2000-07-12  Gabriel Dos Reis  <gdr@codesourcery.com>

	* c-typeck.c (pedwarn_c99): Move to
	* c-errors.c: ... Here.
	* toplev.h (verror, vwarning, vpedwarn): Remove prototypes.
	* diagnostic.c (verror, vwarning, vpedwarn): Make static.
	* Makefile.in (C_AND_OBJC_OBJS): Include c-errors.o
	(c-errors.o): List dependency.

From-SVN: r34984
2000-07-12 14:12:51 +00:00
Gabriel Dos Reis 406a65d0db diagnostic.c (save_output_state): Remove.
2000-07-12  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.c (save_output_state): Remove.
	(restore_output_state): Likewise.
	(clear_text_info): New function.
	(clear_diagnostic_info): Likewise.
	(output_text_length, is_starting_newline, output_prefix,
	line_wrap_cutoff, ideal_line_wrap_cutoff, prefix_was_emitted_for,
	prefixing_policy, output_buffer_ptr_to_format_args): New macros
	(set_real_maximum_length, output_set_maximum_length,
	output_set_prefix, output_get_prefix, output_set_maximum_length,
	output_destroy_prefix, init_output_buffer,
	reshape_diagnostic_buffer, output_space_left, output_emit_prefix,
	output_add_newline, output_add_character, output_add_space,
	output_append_r, output_append, wrap_text, output_format,
	output_do_printf, output_printf, output_do_verbatim,
	output_verbatim, verbatim): Use them.
	(output_clear): Split into cleat_text_info and
	clear_diagnostic_info.
	(struct output_state): Move to...

	* diagnostic.h: ...Here
	(struct output_buffer): Adjust.

From-SVN: r34975
2000-07-12 00:48:02 +00:00
Gabriel Dos Reis 92c26242fa diagnostic.c (output_octal): Second parameter is unsigned.
2000-07-10  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.c (output_octal): Second parameter is unsigned.
	(output_long_octal): Likewise.
	(output_hexadecimal): Likewise.
	(output_long_hexadecimal): Likewise.
	(output_format): Adjust arguments extraction. Tweak.
	(output_verbatim, verbatim): End variable argument list.
	(report_diagnostic): Improve documentation.

From-SVN: r34945
2000-07-10 17:14:25 +00:00
Gabriel Dos Reis 93d87cb15d diagnostic.c (wrap_text): New function.
2000-07-10  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.c (wrap_text): New function.
	(maybe_wrap_text): Likewise.
	(output_add_string): Use it.
	(output_format): Likewise.
	(count_error): Use verbatim instead of notice.
	(report_error_function): Likewise. Don't use plain fprintf.
	(finish_diagnostic): New function.
	(output_do_verbatim): Tweak.  Commonalize functionalities in
	output_verbatim and verbatim.
	(output_verbatim): Adjust.
	(verbatim): Likewise.
	(report_diagnostic): Define.

	* diagnostic.h (report_diagnostic): Prototype.

From-SVN: r34935
2000-07-09 22:51:25 +00:00
Gabriel Dos Reis 8514e31898 diagnostic.c (diagnostic_args): New macro.
2000-07-09  Gabriel Dos Reis  <gdr@codesourcery.com>

	* diagnostic.c (diagnostic_args): New macro.
	(diagnostic_msg): Likewise.
	(output_formatted_integer): Likewise.
	(output_state): New data type.
	(digit_buffer): Make global.
	(output_add_integer): Rename to output_decimal. Squeeze
	digit_buffer.
	(output_long_decimal, output_unsigned_decimal,
	output_long_unsigned_decimal, output_octal, output_long_octal,
	output_hexadecimal, output_long_hexadecimal): New functions.
	(output_append_r): New function.
	(output_append): Tweak.
	(output_flush_on): Rename to output_to_stream.
	(output_format): Change prototype.  Improve documentation. Handle
	more format specifiers.
	(build_location_prefix): Rename to context_as_prefix.
	(output_notice): Rename to output_do_printf.
	(output_printf): Tweak.
	(line_wrapper_printf): Likewise.
	(vline_wrapper_message_with_location): Adjust call to renamed
	functions.
	(v_message_with_decl): Likewise.
	(default_print_error_function): Likewise.
	(save_output_state): New function.
	(restore_output_state): Likewise.
	(output_do_verbatim): Likewise.
	(output_verbatim): Define.
	(verbatim): Likewise.

	* diagnostic.h (printer_fn): Change return type from void to int.
	Improve documentation.
	(output_add_integer): Rename to output_decimal.
	(output_flush_on, output_format): Don't export.
	(output_verbatim, verbatim): Declare.

From-SVN: r34932
2000-07-09 07:51:26 +00:00
Philipp Thomas 5e4adfbabc c-decl.c: Mark strings for translation.
2000-06-28  Philipp Thomas  <pthomas@suse.de>

	* c-decl.c : Mark strings for translation.
	(parmlist_tags_warning): Use distinct messages instead
	of conditional expressions.
	* diagnostic.c (v_message_with_decl): Mark string for translation.
	* gcc.c: Mark messages for translation.
	(display_help): Combine messages into one string where necessary.
	* mips-tfile.c: Add intl.h. Mark messages for translation.
	* rtl.c (fatal_with_file_and_line): Modify function for NLS. Mark
	messages for translation.
	* timevar.c: Mark messages for translation.
	* tlink.c: Likewise.
	* toplev.c: Likewise.

From-SVN: r34773
2000-06-28 23:46:27 +00:00
Richard Henderson 903f51d97f [multiple changes]
2000-06-26  Joseph S. Myers  <jsm28@cam.ac.uk>

        * c-decl.c (grokdeclarator): Don't warn about `long long' in C99.
        Make warnings about implicit int be pedwarns in C99.  Don't warn
        about duplicate type qualifiers in C99.
        (start_function): Make warning about implict int return type be a
        pedwarn in C99.
        * c-lex.c (yylex): Don't warn about `long long' in C99.
        * c-typeck.c (c_expand_return): In C99, always pedwarn about
        `return' with no value in function returning non-void.

2000-06-26  Richard Henderson  <rth@cygnus.com>

        * c-typeck.c (pedwarn_c99): New.
        * diagnostic.c (verror, vwarning, vpedwarn): Export.
        * toplev.h: Prototype them.

From-SVN: r34713
2000-06-26 09:42:23 -07:00
Gabriel Dos Reis 764dbbf2dd diagnostic.c (output_maximum_width): Remove.
2000-06-06  Gabriel Dos Reis  <gdr@codesourcery.com>

        * diagnostic.c (output_maximum_width): Remove.
        (doing_line_wrapping): Tweak.
        (diagnostic_buffer): New object.
        (global_output_buffer): New object.
        (output_destroy_prefix): New function.
        (default_initialize_buffer): Likewise.
        (reshape_diagnostic_buffer): Likewise.
        (initialize_diagnostics): Likewise.
        (output_clear): Tweak.
        (line_wrapper_printf): Adjust call to init_output_buffer.
        (vline_wrapper_message_with_location): Likewise.  Use
        output_destroy_prefix.
        (v_message_with_decl): Likewise.

        * diagnostic.h (struct output_buffer): Constify prefix.
        (init_output_buffer, output_get_prefix): Constify.
        (diagnostic_message_length_per_line): Likewise.
        (reshape_diagnostic_buffer): Declare.
        (default_initialize_buffer): Declare.
        (initialize_diagnostics): Declare.
        (diagnostic_buffer): Declare new obbject.

        * toplev.c: #include diagnostic.h
        (display_help): Document diagnostic formatting options.
        (decode_f_option): Handle diagnostic formatting options.
        (main): Setup initialization for diagnostic messages outputter.

        * toplev.h (set_message_length): Remove.

        * Makefile.in (toplev.o): Depends upon diagnostic.h

        * invoke.texi : Document diagnostics formatting options.

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

        * lex.c (lang_init_options): Tweak.

        * decl2.c: Remove #inclusion of diagnostic.h
        (lang_decode_option): Move diagnostic formatting options to
        toplevel.

        * lang-options.h: Remove documentation for diagnostic options.

        * Makefile.in (lex.o): Depends upon diagnostic.h

From-SVN: r34435
2000-06-06 20:11:40 +00:00
Zack Weinberg fbd4035990 top level:
* diagnostic.c: Eliminate implicit int.
	* except.c, gcc.c: Add static prototypes.
	* final.c (final_end_function): Mark file arg ATTRIBUTE_UNUSED.
	* gensupport.c (process_rtx): Use XVEC to initialize vector
	slot of 'split'.

	* print-rtl.c: If DEBUG_REGISTER_NAMES, define static
	debug_reg_names instead of static reg_names.  If not, define
	global reg_names.
	* regclass.c: Don't define global reg_names unless
	DEBUG_REGISTER_NAMES is defined.

	* reload1.c (order_regs_for_reload): Remove unused variable.
	* varasm.c: Include output.h after defaults.h.  Define
	eh_frame_section as function of no args, not of unspecified args.

	* gcc.c: Constify argbuf; arguments to store_arg,
	process_command, main; elements of struct command and struct
	switchstr; local variables in execute, process_command, main.

cp:
	* except.c: Add static prototypes.

From-SVN: r34054
2000-05-20 19:45:36 +00:00
Gabriel Dos Reis 856b62442f diagnostic.h (DIAGNOSTICS_SHOW_PREFIX_ONCE): New macro.
2000-05-13  Gabriel Dos Reis <gdr@codesourcery.com>

        * diagnostic.h (DIAGNOSTICS_SHOW_PREFIX_ONCE): New macro.
        (DIAGNOSTICS_SHOW_PREFIX_NEVER): Likewise.
        (DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE): Likewise.
        (struct output_buffer: emitted_prefix_p, prefixing_rule): New
        fields.
        (set_message_prefixing_rule): Declare.

        * diagnostic.c: (current_prefixing_rule): New variable.
        (set_message_prefixing_rule): Define.
        (output_set_prefix): Adjust buffer->emitted_prefix_p.
        (init_output_buffer): Adjust Initialization.
        (output_emit_prefix): Rewrite.  Take prefixing rules into account.

cp/

2000-05-13  Gabriel Dos Reis <gdr@codesourcery.com>

        * lex.c: #include diagnostic.h.
        (lang_init_options): Set default prefixing rules.

        * lang-options.h: Add -fdiagnostics-show-location=.

        * decl2.c: #include diagnostic.h.
        (lang_decode_option): Handle -fdiagnostics-show-location=.

From-SVN: r33890
2000-05-14 08:44:48 +00:00
Kaveh R. Ghazi 362440248c bb-reorder.c (get_next_bb_note, [...]): Prototype.
* bb-reorder.c (get_next_bb_note, get_prev_bb_note): Prototype.

	* diagnostic (vbuild_message_string, build_message_string,
	build_location_prefix, output_get_prefix, init_output_buffer,
	output_notice, vline_wrapper_message_with_location,
	v_message_with_decl, default_print_error_function): De-constify.
	(set_real_maximum_length): Prototype.

	* diagnostic.h (struct output_buffer, init_output_buffer,
	output_get_prefix, output_set_prefix): De-constify.

	* function.c (init_function_start): Constify.

	* gensupport.c (remove_constraints, process_rtx): Prototype.

	* gthr-posix.h: Indent uses of #pragma.

	* objc/objc-act.c (ggc_mark_imp_list, ggc_mark_hash_table):
	Prototype.

	* predict.c (find_expected_value): Delete prototype.
	(expected_value_to_br_prob): Initialize variable `ev_reg'.

	* sbitmap.h (debug_sbitmap): Prototype.

	* ssa.c (compute_coalesced_reg_partition): Prototype.

	* stor-layout.c (debug_rli): Prototype.

	* tree.h (round_down): Prototype.
	(init_function_start): Constify.

ch:
	* ch-tree.h (init_function_start): Constify.

From-SVN: r33675
2000-05-04 17:58:40 +00:00
Richard Henderson 6f81b1ade6 diagnostic.c (init_output_buffer): Don't initialize format_args.
* diagnostic.c (init_output_buffer): Don't initialize format_args.
        (output_clear): Likewise.
        (output_printf): Use va_copy.
        (vline_wrapper_message_with_location): Likewise.
        (v_message_with_decl): Likewise.
        (line_wrapper_printf): VA_START infor buffer.format_args directly.
        * system.h (va_copy): Provide default implementation.

From-SVN: r33341
2000-04-22 11:41:05 -07:00
Gabriel Dos Reis 345ed1fe96 diagnostic.h: New file.
2000-04-22  Gabriel Dos Reis  <gdr@codesourcery.com>

        * diagnostic.h: New file.

        * Makefile.in (diagnostic.o): Depends on diagnostic.h

        * diagnostic.c: Tweak.  Rationalize the output logic.  Adjust
        various function prototypes.
        (diagnostic.h): #include.
        (struct output_buffer): Move into diagnostic.h.
        (get_output_prefix): Rename to output_get_prefix.  Export.
        (init_output_buffer): Export. Break out.  Ajust intialization.
        (output_space_left, output_append): Export.
        (output_newline): Rename to output_add_newline.  Export.
        (output_clear): Nullify additional output_buffer fields.
        (output_puts): Rename to output_add_string.  Export.
        (dump_output): Rename to output_flush_on.  Export.
        (build_location_prefix): Constify return-type.
        (emit_output_prefix): Rename to output_emit_prefix. Export.
        (set_real_maximum_length): New function.
        (output_set_maximum_length): Ditto
        (output_clear): Ditto.
        (output_add_character): Ditto.
        (output_add_integer): Ditto.
        (output_add_space): Ditto.
        (output_format): Ditto.
        (output_printf): Adjust buffer initialization.
        (vline_wrapper_message_with_location): Ditto.
        (v_message_with_decl): Ditto.  Adjust call to output_puts
        and get_output_prefix.
        (default_print_error_function): Adjust buffer intialization.

From-SVN: r33337
2000-04-22 11:49:16 +00:00
Kaveh R. Ghazi 3cce094dd9 rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
	(emit_line_note_after, emit_line_note, emit_line_note_force,
	emit_note, decode_asm_operands): Constify.

	* cse.c (canon_hash): Likewise.

	* dbxout.c (dbxout_block): Likewise.

	* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
	v_warning_for_asm): Likewise.

	* dwarfout.c (function_start_label): Likewise.

	* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
	emit_line_note_force): Likewise.

	* final.c (last_filename, asm_insn_count, final_scan_insn,
	output_source_line): Likewise.

	* function.h (struct emit_status): Likewise.

	* gcse.c (hash_expr_1): Likewise.

	* genattr.c (gen_attr, main): Likewise.

	* genattrtab.c (struct function_unit, current_alternative_string,
	write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
	attr_numeral, check_attr_test, check_attr_value,
	convert_set_attr_alternative, convert_set_attr,
	compute_alternative_mask, simplify_by_exploding, gen_attr,
	gen_unit): Likewise.

	* genflags.c (gen_insn): Likewise.

	* gengenrtl.c (type_from_format): Likewise.

	* genopinit.c (gen_insn): Likewise.

	* genoutput.c (n_occurrences, process_template, process_template):
	Likewise.

	* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
	Likewise.

	* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
	Likewise.

	* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
	ggc_set_mark, ggc_get_size): Likewise.

	* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.

	* optabs.c (init_one_libfunc): Likewise.

	* output.h (assemble_start_function): Likewise.

	* recog.c (decode_asm_operands): Likewise.

	* toplev.c (rest_of_compilation): Likewise.

	* tree.h (emit_line_note_after, emit_line_note,
	emit_line_note_force): Likewise.

	* varasm.c (asm_output_bss, asm_output_aligned_bss,
	asm_emit_uninitialised, assemble_start_function,
	assemble_variable, const_hash, compare_constant_1,
	find_pool_constant, mark_constant_pool, assemble_alias): Likewise.

	* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.

	* alpha/alpha.md (call_vms, call_value_vms): Likewise.

	* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.

	* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.

	* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
	arm_dllimport_name_p): Likewise.

	* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
	Likewise.

	* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.

	* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
	arm_mark_dllexport, arm_mark_dllimport,
	arm_pe_encode_section_info): Likewise.

	* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
	ASM_FINISH_DECLARE_OBJECT): Likewise.

	* arm/thumb.c (thumb_function_prologue): Likewise.

	* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.

	* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.

	* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.

	* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.

	* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
	ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.

	* i386/i386-protos.h (asm_output_function_prefix): Likewise.

	* i386/i386.c (asm_output_function_prefix): Likewise.

	* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.

	* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.

	* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
	ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
	ASM_OUTPUT_SECTION_NAME): Likewise.

	* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.

	* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.

	* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.

	* m32r/m32r.c (m32r_encode_section_info): Likewise.

	* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mcore/mcore.c (mcore_encode_section_info): Likewise.

	* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.

	* mips/mips.md (movdi, movsi): Likewise.

	* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.

	* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
	ASM_OUTPUT_ASCII): Likewise.

	* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
	output_mi_thunk, output_toc): Likewise.

	* rs6000/rs6000.md (movsi): Likewise.

	* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.

	* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.

	* v850/v850.c (print_operand, print_operand_address,
	v850_encode_data_area): Likewise.

ch:
	* grant.c (globalize_decl): Constify a char*.

cp:
	* decl2.c (finish_objects): Constify a char*.

	* method.c (emit_thunk): Likewise.

From-SVN: r32388
2000-03-07 20:39:10 +00:00
Richard Kenner 4eda9c6582 * diagnostic.c (init_output_buffer): Handle case of null PREFIX.
From-SVN: r32112
2000-02-23 07:17:57 -05:00
Jason Merrill cfbad224f6 fix comment
From-SVN: r32106
2000-02-22 17:12:59 -05:00
Gabriel Dos Reis abcabbbf3e diagnostic.c (init_output_buffer): Make it possible to output at least 32 characters if we're given a too long prefix.
2000-02-21  Gabriel Dos Reis  <gdr@codesourcery.com>

        * diagnostic.c (init_output_buffer): Make it possible to output at
        least 32 characters if we're given a too long prefix.

From-SVN: r32091
2000-02-21 20:17:41 +00:00
Kaveh R. Ghazi c69916605c Makefile.in (c-common.o): Depend on $(EXPR_H).
* Makefile.in (c-common.o): Depend on $(EXPR_H).

	* c-common.c: Include expr.h.

	* c-pragma.c (mark_align_stack): Add prototype.

	* caller-save.c (add_stored_regs): Likewise.

	* combine.c (record_promoted_value): Likewise.

	* i386.c (ix86_sched_reorder_pentium, ix86_sched_reorder_ppro):
	Likewise.

	* cppinit.c (new_pending_define): Likewise.

	* cpplib.c (skip_block_comment, skip_line_comment): Likewise.

	* dwarf2out.c (save_rtx, splice_child_die, reverse_die_lists,
	AT_class, AT_flag, AT_int, AT_unsigned, AT_string, AT_ref, AT_loc,
	AT_addr, AT_lbl, get_AT_ref, free_AT, free_die, local_scope_p,
	class_scope_p): Likewise.

	* dwarf2out.h (dwarf2out_set_demangle_name_func,
	dwarf2out_add_library_unit_info): Likewise.

	* ggc.h (ggc_page_print_statistics): Likewise.

	* haifa-sched.c (propagate_deps): Likewise.

	* reg-stack.c (next_flags_user, record_label_references): Likewise.

	* rtl.h (set_stack_check_libfunc): Likewise.

	* toplev.h (set_fatal_function): Likewise.

	* toplev.c (set_fatal_function): Delete prototype.

	* diagnostic.c: Deconstify functions returning malloc'ed ptrs.

From-SVN: r31810
2000-02-06 03:40:46 +00:00
Kaveh R. Ghazi b9ff481444 diagnostic.c (build_message_string, [...]): Add ATTRIBUTE_PRINTF_*.
* diagnostic.c (build_message_string, output_printf,
        line_wrapper_printf): Add ATTRIBUTE_PRINTF_*.
        (build_location_prefix): Fix non-literal format string.

From-SVN: r31669
2000-01-28 16:34:00 +00:00
Kaveh R. Ghazi 83d2b3b9dc cccp.c: PROTO -> PARAMS.
* cccp.c: PROTO -> PARAMS.
	* cexp.y: Likewise.
	* collect2.c: Likewise.
	* combine.c: Likewise.
	* convert.h: Likewise.
	* cse.c: Likewise.
	* dbxout.c: Likewise.
	* dbxout.h: Likewise.
	* diagnostic.c: Likewise.
	* doprint.c: Likewise.
	* dwarf2out.c: Likewise.
	* dwarf2out.h: Likewise.
	* dwarfout.c: Likewise.
	* dwarfout.h: Likewise.
	* dyn-string.h: Likewise.

From-SVN: r31399
2000-01-14 00:46:57 +00:00
Gabriel Dos Reis b903d81e07 2000-01-12 Gabriel Dos Reis <gdr@codesourcery.com>
Implement automatic line wrapping mode in the g++ front-end.

From-SVN: r31343
2000-01-12 01:54:31 +00:00
Kaveh R. Ghazi cfa9f25220 diagnostic.c (v_message_with_decl): Use .* format specifier instead of building the format specifier width manually.
* diagnostic.c (v_message_with_decl): Use .* format specifier
       instead of building the format specifier width manually.

From-SVN: r31101
1999-12-27 16:52:03 +00:00
Gabriel Dos Reis 6ed551b487 toplev.c (notice, [...]): Move to diagnostic.c
1999-12-18 Gabriel Dos Reis  <gdr@codesourcery.com>

        * toplev.c (notice, vmessage, v_message_with_file_and_line,
        v_message_with_decl, file_and_line_for_asm,
        v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
        verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
        v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
        v_pedwarn_with_file_and_line, vsorry, vnotice, count_error,
        pfatal_with_name, fatal_io_error, need_error_newline,
        last_error_function, last_error_tick, announce_function,
        default_print_error_function, print_error_function,
        report_error_function, fnotice, error_with_file_and_line,
        error_with_decl, error_for_asm, error, set_fatal_function, fatal,
        _fatal_insn, _fatal_insn_not_found, warning_with_file_and_line,
        warning_with_decl, warning_for_asm, warning, pedwarn,
        pedwarn_with_decl, pedwarn_with_file_and_line, sorry): Move to
        diagnostic.c
        (compile_file): Use fnotice instead of notice.  Adjust call.

        * diagnostic.c: New file.

        * Makefile.in (OBJS): Include diagnostic.o
        (diagnostic.o): Define dependence.

From-SVN: r31003
1999-12-18 01:45:40 +00:00