Building on D126796, this commit adds the infrastructure for being able
to print out descriptions of what each warning does.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you post some examples of the output from this option so we can see what the end results look like more easily?
Right now this doesn't do anything at all, except feed the documentation from tablegen to Clang. It's just taking the text (represented by ...) from code Documentation [{...}], trimming any surrounding spaces, and putting that into DIAG_ENTRY.
e.g.
code Documentation [{ Hello, world! Goodbye, world! }]
would be forwarded as "Hello, world!\n\n Goodbye, world!"
Thanks, that helps me to visualize what's going on. Any thoughts on how we could test this functionality, or are we going to assume that the testing comes from its usage when we actually make use of the new information threaded in?
clang/lib/Basic/DiagnosticIDs.cpp | ||
---|---|---|
628 | ||
clang/utils/TableGen/ClangDiagnosticsEmitter.cpp | ||
1550–1553 | Isn't this functionally equivalent? (It means we're using a raw empty string rather than a normal empty string, but that shouldn't matter.) |
Good question. Unless this functionality already has tests (and I'm gathering it doesn't), I think we can rely on Clang being the test. (Though we should consider ourselves on notice for adding robust unit tests at some point.)
clang/utils/TableGen/ClangDiagnosticsEmitter.cpp | ||
---|---|---|
1550–1553 | Wow, I can no longer say I've never done if (condition) return true; else return false; 😂 |
Good question. Unless this functionality already has tests (and I'm gathering it doesn't), I think we can rely on Clang being the test. (Though we should consider ourselves on notice for adding robust unit tests at some point.)
I don't know of tests for it, so I'm okay with that approach. LGTM!