This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH diagnostics] PR 53061 cleanup initialization
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 26 Oct 2014 22:34:22 +0100
- Subject: Re: [PATCH diagnostics] PR 53061 cleanup initialization
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQCJRGpewUNm8GJx8hr0wqLx7RUVKh5OUkL=cGw-ETe3sg at mail dot gmail dot com> <87vbnbkrg1 dot fsf at redhat dot com>
I committed this as https://gcc.gnu.org/r216720 following all your
comments except for:
On 23 October 2014 12:31, Dodji Seketeli <dodji@redhat.com> wrote:
>> +
>> +/* Construct a C++-aware pretty-printer for CONTEXT. It is assumed
>> + that CONTEXT->printer is an already constructed basic pretty_printer. */
>
> I'd be even more specific in the comment by saying that CONTEXT->printer
> is a basic pretty printer that was constructed presumably by
> diagnostic_initialize(), called early in the compiler's initialization
> process (in general_init) Before the FE is initialized. This (C++)
> FE-specific diagnostic initializer is thus replacing the basic pretty
> printer with one that has C++-aware capacities.
>
> Or maybe write this generic big-picture awareness comment before the
> diagnostic_context::printer data member. If you don't have time for
> this, I'll do it myself in a subsequent patch. I am writing this, also
> for myself, as a reminder :-)
I did the former and not the latter because the basic pp does not need
to be overridden, the FEs can do it but they don't need to. Thus, I
was not sure what you really wanted me to write in diagnostic.h The
current comment is:
/* Where most of the diagnostic formatting work is done. */
pretty_printer *printer;
which admittedly is not that informative.
Cheers,
Manuel.