[cfe-dev] Notes in Clang diagnostics and LLVM DiagnosticInfo
Eric Christopher
echristo at gmail.com
Tue Feb 25 11:35:18 PST 2014
On Tue, Feb 25, 2014 at 3:26 AM, Chris Lattner <clattner at apple.com> wrote:
> On Feb 25, 2014, at 2:29 AM, Tobias Grosser <tobias at grosser.es> wrote:
>>>> // Report the backend message using the usual diagnostic mechanism.
>>>> FullSourceLoc Loc;
>>>> - Diags.Report(Loc, DiagID).AddString(MsgStorage);
>>>> + DiagnosticBuilder DB = Diags.Report(Loc, DiagID);
>>>> + DB.setForceEmit();
>>>> + DB.AddString(MsgStorage);
>>>>
>>>> We could use this to either force printing of all backend diagnostics or only the notes. However, I am afraid that would break existing flags to suppress diagnostics.
>>> Would it be hard to check what is the actual behavior?
>>> That would indeed be unfortunate!
>>
>> As Richard confirmed, using 'note' to provide information not attached to another warning or error is not intended. I submitted two patches
>> to introduce a new 'remark' type that can be used for exactly this purpose.
>
> How about calling these "informative" diagnostics, and use "info:" for them? That seems more descriptive than remark.
>
Seems like a good idea. :)
-eric
More information about the cfe-dev
mailing list