[PATCH] D129538: [clang] adds prototype for being able to alternate diagnostic formats

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 13 06:00:32 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/Diagnostic.h:212-214
+/// Abstract interface for diagnostic contexts (traditionally: notes).
+/// A BasicDiagnostic may have as many different contexts as required to provide
+/// users with a complete picture.
----------------
To make sure I understand, notes are one context, but are error/warning/remarks another context, and same for fixits?

I'm having a hard time understanding how you expect to use this; in the diagnostics engine, notes are like any other diagnostic, so are you going to look at the diagnostic ID and dispatch to either the `BasicDiagnostic` or the `DiagnosticContext` interface? I'd appreciate a bit more information on how this separation works.


================
Comment at: clang/include/clang/Basic/Diagnostic.h:1024
+  void setSarifWriter(SarifDocumentWriter *W) { SarifWriter = W; }
+  SarifDocumentWriter *getSarifWriter() const { return SarifWriter; }
+
----------------
Question: should we have the overload set so that you get a const writer on a const engine and a non-const writer on a non-const engine?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129538



More information about the cfe-commits mailing list