Add 'remark' diagnostic type in clang

Arthur O'Dwyer arthur.j.odwyer at gmail.com
Thu Feb 27 18:40:55 PST 2014


On Thu, Feb 27, 2014 at 6:23 PM, Tobias Grosser <tobias at grosser.es> wrote:

> On 02/26/2014 10:27 PM, Tobias Grosser wrote:
>
>> On 02/26/2014 10:19 PM, Chris Lattner wrote:
>>
>>> On Feb 26, 2014, at 2:22 AM, Tobias Grosser <tobias at grosser.es> wrote:
>>>
>>>>
>>>>  3) How to enable 'remarks'
>>>>
>>>> We need a way to enable 'remark' diagnostics. Quentin proposed to go
>>>> for an approach similar to the warning flags. Where we control remarks
>>>> with '-Rvector', '-Rloop-vector', ...
>>>>
>>>> I will read a little bit through the existing option system to better
>>>> understand what it is doing, possibly adding documentation / cleanups
>>>> on my way. I will come back with a proposal here.
>>>>
>>>
>>> It’s a bit odd, but since these are diagnostics, why not use the
>>> existing -W flags?  You should be able to -Werror one of these,
>>> control them with #pragma clang diagnostics, etc.  It doesn’t seem
>>> like we need more complexity in this space.
>>>
>>
>> Good point. I will prepare the above patches such that they reuse the
>> existing infrastructure. If we really see a need for further
>> adjustments, we can do this incrementally.
>>
>
> I just updated the patch to reflect the conclusions of our discussion.
> Please review for commit.
>
> ------------
> [PATCH] Add 'remark' diagnostic type in 'clang'
>
>
> A 'remark' is information that is not an error or a warning, but rather
> some additional information provided to the user. In contrast to a 'note' a
> 'remark' is an independent diagnostic, whereas a 'note' always depends on
> another diagnostic.
>
> A typical use case for remark nodes is information provided to the user,
> e.g. information provided by the vectorizer about loops that have been
> vectorized.
>
> This patch provides the initial implementation of 'remarks'. It includes
> the actual definiton of the remark nodes, their printing as well as basic
> parameter handling. We are reusing the existing diagnostic parameters which
> means a remark
> can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded
> to an error using '-Werror=diagnostic-name'.
>

For the record, I strongly recommend that the syntax to enable a remark
should be "-Wremark=diagnostic-name", and that "-Wdiagnostic-name" should
(continue to) mean "upgrade this diagnostic to a warning".
However, I have no objection to the current semantics for an initial
checkin, as long as nobody uses it as an excuse to keep those semantics
forever.

my $.02,
–Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140227/dc83173e/attachment.html>


More information about the cfe-commits mailing list