[cfe-dev] How to assign a Custom Diagnostic IDs in Clang Tool

Roman Popov via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 1 13:37:44 PST 2018


Probably I'm just thinking in wrong direction. Why do I need to have fixed
IDs, instead I should probably have fixed error/warning names?

On Feb 1, 2018 1:12 PM, "Roman Popov" <ripopov at gmail.com> wrote:

> Looks like DiagnosticEngine does not allow to be instantiated with
> User-supplied IDs.
> The problem is that DiagnosticIDs is not an interface to IDs database, but
> rather a final class not designed for inheritance.
>
> So I don't find a way how Clang diagnostic library can be reused by 3rd
> party tool.
>
> 2018-02-01 12:10 GMT-08:00 Roman Popov <ripopov at gmail.com>:
>
>> Hello,
>> I want to create a fixed sets of IDs for error messages in Clang tool. So
>> I can put them into tool documentation.
>>
>> Is it possible to somehow assign a fixed ID for diagnostic?
>> DiagnosticEngine::getCustomDiagID() generates ID automatically, so I
>> have no control on IDs.
>>
>> Should I probably instantiate my own DiagnosticEngine instead of using
>> one from AstContext ?
>>
>> Thanks,
>> Roman
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180201/9c10562f/attachment.html>


More information about the cfe-dev mailing list