Hello,<br><br>Here are two small patches to begin on the road toward improving diagnostics documentation.<br><br>The goal here is to provide a way for the user, either through libclang, the clang binary, or the website, to get some documentation for a particular diagnostic that has been raised during the compilation.<br>
<br>Those two patches implement the first drop:<br>> Extension of the Diagnotic object with 3 fields: Name (simply the enum under a char const* form), Brief (a summary of the issue), Explanation (an extensive explanation of the issue, possibly with various illustrations and their corrections, in case a single fix-it is not suitable)<br>
> Provide an option in the Driver to activate/deactive printing the name of the Diagnostic in the error output (active by default), print the Diagnostic name in the error output (for all but notes), provide a test case for the option (active/inactive)<br>
> Implement an Index to get back the Diagnostic ID from a name (log2 N complexity as it's a sorted array, N ~ 2173 in my revision)<br><br>*Important*: I do not use the Makefile system, and as such was not able to check whether this still built. It's kind of a special patch since we generate a new file with tblgen...<br>
<br>*Important*: As any modification of the tblgen backend, the two patches (against clang and llvm) are interdependent.<br><br>Note: I first tried dropping the "prefix" of the enum (warn_, fatal_, etc...) however this created conflicts between different diagnostics. I am not strongly attached to either dropping it or not, but since dropping it involved renaming some enums, I preferred using the full name for now.<br>
<br>Matthieu.<br>