[PATCH] D129886: [clang] Add -fdiagnostics-format=sarif option for future SARIF output

Denis Nikitin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 18 12:03:02 PDT 2022


denik added a comment.

Thanks for adding the flag!



================
Comment at: clang/include/clang/Basic/DiagnosticGroups.td:1383
+
+def SarifFormatUnstable : DiagGroup<"sarif-format-unstable">;
----------------
cjdb wrote:
> Please make sure that there's a newline at the end of each file.
I guess you don't need a new entry here since you used InGroup<DiagGroup<"sarif-format-unstable">>.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:4009
     CmdArgs.push_back(A->getValue());
+    if (std::string(A->getValue()) == "sarif") {
+      D.Diag(diag::warn_drv_sarif_format_unstable);
----------------
nit: I would replace it with StringRef.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129886/new/

https://reviews.llvm.org/D129886



More information about the cfe-commits mailing list