Adds sarif option to the existing -fdiagnostics-format flag
for intended future work with SARIF diagnostics. Currently issues a warning
against the use of diagnostics in SARIF mode, then defaults to clang style for
diagnostics.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thanks for getting this started! To get this ready for submission, would you be able to add a test please?
I already couldn't find any mention of -fdiagnostics-format or sarif when I ran clang --help. Is there somewhere else I should look?
clang/include/clang/Basic/DiagnosticDriverKinds.td | ||
---|---|---|
684 | Please let me know if there's a better warning group you think this should be in. |
Interesting, fdiagnostics-format doesn't show up in either --help or --help-hidden.
Please disregard my earlier comment in that case, thanks!
clang/include/clang/Basic/DiagnosticDriverKinds.td | ||
---|---|---|
684 | Nope! This is the right way to do it :) | |
clang/include/clang/Basic/DiagnosticGroups.td | ||
1383 ↗ | (On Diff #445554) | Please make sure that there's a newline at the end of each file. |
clang/test/Driver/fdiagnostics-format-sarif.cpp | ||
1 ↗ | (On Diff #445554) | This test should check not only that we're able to use the flag, but also that it emits the warning. |
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
4009–4011 | Do we want to be kind to people who spell it SARIF (given that it's an acronym, some folks may spell it that way reflexively)? |
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
4009–4011 | tbh I think it's worth accepting both sarif and SARIF, if we can. |
Please address the whitespace changes in clang/lib/Driver/ToolChains/Clang.cpp.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
81–82 | nit: Looks like this an unrelated format change/ rebase issue. There are a few others as well in this file Would be better to introduce these through another CR, or use git clang-format <commit-start> [<commit-end>] to limit it to the diff. |
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
4009–4011 | Ah yeah that would definitely be helpful. |
Removed unintended formatting.
clang/lib/Driver/ToolChains/Clang.cpp | ||
---|---|---|
81–82 | Thanks! Did not realize format changed all that :) |
Please let me know if there's a better warning group you think this should be in.