On Wed, 2020-08-26 at 09:37 -0400, Nathan Sidwell wrote:
> Hi,
> I had a need to add a new type of informative message on the modules 
> branch, with an option to enable it.  The message is not a warning or
> an 
> error, but just 'hey, you asked if X happens.  It happens just
> here'. 
> This is emitted as a note.  I chose -fnote-$NAME for the option, but 
> that wasn't a very satisfactory solution.
> 
> I have learnt that clang has -R$NAME options for exactly this kind
> of 
> informative note.  Presumably with -Rno-$NAME negation.
> 
> Presumably we could also use this for optimization notes -- 'I failed
> to 
> vectorize this loop because ...'
> 
> thoughts?

I like the idea.

FWIW I implemented something like this as part of my revamping of
optinfo in gcc 9.

I wrote a patch that added "remarks" to the diagnostic framework, which
can be seen here:
  https://gcc.gnu.org/legacy-ml/gcc-patches/2018-07/msg00067.html
though that patch is somewhat coupled to the optinfo stuff.  IIRC it
was somehow eventually dropped; I think I ended up just
extending/updating the -fopt-info output, and the "remarks"
infrastructure never made it into trunk (possibly due to a desire to
avoid duplication; I can't quite remember the details).

Dave

Reply via email to