[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:12:10 PST 2018


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/28e2442c/attachment.html>


More information about the cfe-dev mailing list