================
@@ -7,6 +7,24 @@ Both provide a way of driving the analyzer, detecting 
compilation flags, and gen
 CodeChecker is more actively maintained, provides heuristics for working with 
multiple versions of popular compilers and it also comes with a web-based GUI 
for viewing, filtering, categorizing and suppressing the results.
 Therefore CodeChecker is recommended in case you need any of the above 
features or just more customizability in general.
 
+Machine-readable output
+-----------------------
+
+For a direct analysis of a source file, the ``clang`` driver can write a SARIF 
report that is suitable for automation and AI agents::
+
+  $ clang --analyze --analyzer-output sarif -o report.sarif source.c
+
+``--analyzer-output`` selects the report format.
+The available formats are ``html``, ``plist``, ``plist-multi-file``, 
``plist-html``, ``sarif``, ``sarif-html``, and ``text``.
+``sarif`` writes a SARIF JSON report to the path specified by ``-o``; 
``sarif-html`` also creates HTML files for interactive inspection.
+The default format is ``plist``.
+
+This direct form analyzes a translation unit.
+For project-wide analysis, use a tool such as CodeChecker or scan-build to 
drive the individual compiler invocations.
----------------
steakhal wrote:

LLVM tooling should always come before 3rd party tools.
```suggestion
For project-wide analysis, use a tool such as scan-build or CodeChecker to 
drive the individual compiler invocations.
```

https://github.com/llvm/llvm-project/pull/209519
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to