aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@codesourcery.com>2000-06-06 20:11:40 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2000-06-06 20:11:40 +0000
commit764dbbf2ddb0b5602ae03f0ecb2c8078587e41dd (patch)
tree426d57102b49f5aa4ea84d91a2b883687998bed2 /gcc/toplev.c
parent93136754c17836b592089e2c335108870344aead (diff)
downloadgcc-764dbbf2ddb0b5602ae03f0ecb2c8078587e41dd.zip
gcc-764dbbf2ddb0b5602ae03f0ecb2c8078587e41dd.tar.gz
gcc-764dbbf2ddb0b5602ae03f0ecb2c8078587e41dd.tar.bz2
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
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 91a1dff..2757932 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -62,6 +62,7 @@ Boston, MA 02111-1307, USA. */
#include "loop.h"
#include "regs.h"
#include "timevar.h"
+#include "diagnostic.h"
#ifndef ACCUMULATE_OUTGOING_ARGS
#define ACCUMULATE_OUTGOING_ARGS 0
@@ -3703,6 +3704,8 @@ display_help ()
printf (" -fcall-used-<register> Mark <register> as being corrupted by function calls\n");
printf (" -fcall-saved-<register> Mark <register> as being preserved across functions\n");
printf (" -finline-limit=<number> Limits the size of inlined functions to <number>\n");
+ printf (" -fmessage-length=<number> Limits diagnostics messages lengths to <number> characters per line. 0 suppresses line-wrapping\n");
+ printf (" -fdiagnostics-show-location=[once | never] Indicates how often source location information should be emitted, as prefix, at the beginning of diagnostics when line-wrapping\n");
for (i = NUM_ELEM (f_options); i--;)
{
@@ -3990,6 +3993,21 @@ decode_f_option (arg)
nm = xstrdup (option_value);
stack_limit_rtx = gen_rtx_SYMBOL_REF (Pmode, nm);
}
+ else if ((option_value
+ = skip_leading_substring (arg, "message-length=")))
+ diagnostic_message_length_per_line =
+ read_integral_parameter (option_value, arg - 2,
+ diagnostic_message_length_per_line);
+ else if ((option_value
+ = skip_leading_substring (arg, "diagnostics-show-location=")))
+ {
+ if (!strcmp (option_value, "once"))
+ set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_ONCE);
+ else if (!strcmp (option_value, "every-line"))
+ set_message_prefixing_rule (DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE);
+ else
+ error ("Unrecognized option `%s'", arg - 2);
+ }
else if (!strcmp (arg, "no-stack-limit"))
stack_limit_rtx = NULL_RTX;
else if (!strcmp (arg, "preprocessed"))
@@ -4433,6 +4451,9 @@ main (argc, argv)
ggc_add_tree_root (&current_function_decl, 1);
ggc_add_tree_root (&current_function_func_begin_label, 1);
+ /* Initialize the diagnostics reporting machinery. */
+ initialize_diagnostics();
+
/* Perform language-specific options intialization. */
lang_init_options ();
@@ -4589,6 +4610,9 @@ main (argc, argv)
i++;
}
}
+
+ /* Reflect any language-specific diagnostic option setting. */
+ reshape_diagnostic_buffer ();
/* Checker uses the frame pointer. */
if (flag_check_memory_usage)