This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Move caret printing to diagnostics_finalizer


Hi Dodji,

This patch is in preparation for further patches moving the Fortran FE
to use the common diagnostics machinery.

Fortran has its own way of printing the caret information, so we need
a way to override the default in the diagnostics machinery. A simple
way is to move the printing of the caret (plus the destruction of the
prefix and printing a newline at the end)  to the
diagnostic_finalizer, so Fortran can override the whole thing with its
own finalizer.

This means that the c-family finalizer needs to invoke the caret
explicitly. The C++ finalizer was destroying the prefix even thought
this was done by the common code anyway. Thus now there is only one
finalizer for both C and C++.

Bootstrapped and regression tested on x86-64-linux.

OK?


gcc/ChangeLog:

2014-08-16  Manuel López-Ibáñez  <manu.gnu.org>

    * diagnostic.c (default_diagnostic_finalizer): Move caret printing
     to here ...
    (diagnostic_report_diagnostic): ... from here.
    * toplev.c (general_init): Move code to c-family.

gcc/cp/ChangeLog:

2014-08-16  Manuel López-Ibáñez  <manu.gnu.org>

    * error.c (cp_diagnostic_finalizer): Delete.
    (init_error): Do not set diagnostic_finalizer here.

gcc/c-family/ChangeLog:

2014-08-16  Manuel López-Ibáñez  <manu.gnu.org>

    * c-opts.c: Include tree-diagnostics.h.
    (c_diagnostic_finalizer): New.
    (c_common_initialize_diagnostics): Use it.

Attachment: fortran-diagnostics-part2.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]