[PATCH] D53982: Output "rule" information in SARIF

Umann Kristóf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 12 14:40:42 PST 2018


Szelethus added inline comments.


================
Comment at: lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:237-242
+#define GET_CHECKERS
+#define CHECKER(FULLNAME, CLASS, CXXFILE, HELPTEXT, GROUPINDEX, HIDDEN)        \
+  .Case(FULLNAME, HELPTEXT)
+#include "clang/StaticAnalyzer/Checkers/Checkers.inc"
+#undef CHECKER
+#undef GET_CHECKERS
----------------
aaron.ballman wrote:
> Szelethus wrote:
> > aaron.ballman wrote:
> > > Szelethus wrote:
> > > > Szelethus wrote:
> > > > > Hmmm, this won't handle checkers loaded from plugins.
> > > > I don't immediately know the solution is to this, but when you invoke clang with `-cc1 -analyzer-checker-help`, plugin checkers are also displayed, and [[ https://github.com/llvm-mirror/clang/blob/master/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp#L150 | this is line that magically does it ]].
> > > > Maybe store the plugins in `AnalyzerOptions`, and move `ClangCheckerRegistry` to `include/clang/StaticAnalyzer/Frontend`?
> > > Oof, this is a good point. Thank you for bringing it up! I'll look into this as soon as I have the chance.
> > > 
> > > Do we have any tests that use plugins (preferably on Windows) so that I have a way to test this functionality out?
> > I'm working on the exact same issue, which is why I spotted this! There are some in `unittests/`, but I plan on enhancing them //a lot// in the coming days. I'll make sure to add you as subscriber on related paches, until then, unless users of the Saris output are likely to use the StaticAnalyzer with plugins, I think feel free to wait on my progress. I expect to come out with a patch during the week. But you never know, I guess.
> > 
> > https://github.com/llvm-mirror/clang/blob/master/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
> I'm fine with waiting. I don't expect to see heavy use of the Sarif exporter until the spec is finalized, as it's hard to write a Sarif viewer against a moving target. So we've got a few months to find these sort of things out.
> 
> Thank you for CCing me on the related patches!
Well, yea, skeletons are falling out of the closet left and right, so I'll need to clean a lot of other things up before finding a neat solution to this. Please let me know when you need to make progress on this.


https://reviews.llvm.org/D53982





More information about the cfe-commits mailing list