Hello,

Here are two small patches to begin on the road toward improving diagnostics
documentation.

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.

Those two patches implement the first drop:
> 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)
> 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)
> 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)

*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...

*Important*: As any modification of the tblgen backend, the two patches
(against clang and llvm) are interdependent.

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.

Matthieu.

Attachment: llvm_diagnostic_1b.diff
Description: Binary data

Attachment: clang_diagnostic_1b.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to