A simple implementation of caret diagnostics.

In the testsuite, pruning the caret output does not always work
because of several known deficiencies of DejaGNU, thus in some places
I disable the caret explicitly.

Bootstrapped and regression tested on x86_64-unknown-gnu-linux with
enable-languages=all,ada and -m32/-m64.

OK to commit?

2012-04-05  Manuel López-Ibáñez  <m...@gcc.gnu.org>

        PR 24985
        * testsuite/lib/prune.exp: Handle caret.
        * testsuite/lib/libmudflap.exp: Handle caret.
        * diagnostic.h (show_caret): Declare.
        * diagnostic.c (diagnostic_initialize): Initialize to false.
        (diagnostic_show_locus): New.
        (diagnostic_report_diagnostic): Call it.
        * input.c (read_line): New.
        (location_get_source_line): New.
        * input.h (location_get_source_line): Declare.
        * toplev.c (general_init): Initialize show_caret from options.
        * testsuite/lib/prune.exp: Add -fno-diagnostics-show-caret.
        * testsuite/gcc.dg/torture/tls/tls.exp: Add -fno-diagnostics-show-caret.
        * dwarf2out.c (gen_producer_string): Handle fdiagnostics-show-caret.
        * opts.c (common_handle_option): Likewise.
        * common.opt (fdiagnostics-show-caret): New option.

Attachment: caret-diagnostics-20120406.diff
Description: Binary data

Reply via email to