[PATCH] D145201: [clang] fixes header processing for `-fdiagnostics-format=sarif`

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 3 07:06:43 PST 2023


aaron.ballman added a comment.

It looks like there's a valid precommit CI failure that needs to be addressed:

  ********************
  Failed Tests (1):
    Clang :: Frontend/sarif-diagnostics.cpp



================
Comment at: clang/lib/Frontend/SARIFDiagnostic.cpp:214
 void SARIFDiagnostic::emitIncludeLocation(FullSourceLoc Loc, PresumedLoc PLoc) {
-  assert(false && "Not implemented in SARIF mode");
+  SarifRule Rule = SarifRule::create().setRuleId(std::to_string(-1));
+  Rule = addDiagnosticLevelToRule(Rule, DiagnosticsEngine::Level::Note);
----------------
Why do we want -1 as the rule ID and... can we use `"-1"` instead of doing a string conversion?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145201



More information about the cfe-commits mailing list