martong created this revision. martong added reviewers: NoQ, Szelethus, xazax.hun, dkrupp. Herald added subscribers: cfe-commits, Charusso, gamesh411, donat.nagy, arphaman, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, whisperity. Herald added a project: clang.
We add a new common html file that documents the available command line tools. Also a new html is added for a brief description of CodeChecker, this way complementing scan-build. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D70439 Files: clang/www/analyzer/codechecker.html clang/www/analyzer/command-line.html clang/www/analyzer/index.html
Index: clang/www/analyzer/index.html =================================================================== --- clang/www/analyzer/index.html +++ clang/www/analyzer/index.html @@ -72,9 +72,9 @@ <p>The Clang Static Analyzer is a source code analysis tool that finds bugs in C, C++, and Objective-C programs.</p> -<p>Currently it can be run either as a <a href="scan-build.html">standalone -tool</a> or <a href="xcode.html">within Xcode</a>. The standalone tool is -invoked from the command line, and is intended to be run in tandem with a build +<p>Currently it can be run either from the <a href="command-line.html">command + line</a> or if you use macOS then <a href="xcode.html">within Xcode</a>. When +invoked from the command line, it is intended to be run in tandem with a build of a codebase.</p> <p>The analyzer is 100% open source and is part of the <a Index: clang/www/analyzer/command-line.html =================================================================== --- /dev/null +++ clang/www/analyzer/command-line.html @@ -0,0 +1,50 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <title>Running the analyzer from the command line</title> + <link type="text/css" rel="stylesheet" href="content.css"> + <link type="text/css" rel="stylesheet" href="menu.css"> + <script type="text/javascript" src="scripts/menu.js"></script> +</head> +<body> + +<div id="page"> +<!--#include virtual="menu.html.incl"--> +<div id="content"> + +<h1>Running the analyzer from the command line</h1> + +<p>The following tools are used commonly to run the analyzer from the command line. +Both tools are wrapper scripts to drive the analysis and the underlying invocations of the Clang compiler: +<ol> + <li><a href="scan-build.html">scan-build</a></li> + <ul> + <li>Preferred on macOS.</li> + <li>In tree, part of the LLVM project.</li> + <li>Provides limited and unsupported <a href="https://clang.llvm.org/docs/analyzer/user-docs/CrossTranslationUnit.html">Cross Translation Unit (CTU) analysis</a> capabilities. + </li> + </ul> + <li><a href="codechecker.html">CodeChecker</a></li> + <ul> + <li>Preferred on Linux.</li> + <li>Out-of-tree, not part of the LLVM project, hosted on github.</li> + <li>On Linux there are many projects for embedded devices which are built only with GCC. + CodeChecker converts these GCC invocations to the appropriate Clang invocations, this way the CSA can work on these projects seamlessly. + </li> + <li><a href="https://clang.llvm.org/docs/analyzer/user-docs/CrossTranslationUnit.html">Cross Translation Unit (CTU) analysis</a> is supported fully on Linux via CodeChecker. + </li> + <li>Supports incremental analysis: Results can be stored in a database, subsequent analysis runs can be compared to list the newly added defects. + </ul> +</ol> +</p> + +<p> +</p> +<p> +</p> + +</div> +</div> +</body> +</html> Index: clang/www/analyzer/codechecker.html =================================================================== --- /dev/null +++ clang/www/analyzer/codechecker.html @@ -0,0 +1,58 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> + <title>CodeChecker: running the analyzer from the command line</title> + <link type="text/css" rel="stylesheet" href="content.css"> + <link type="text/css" rel="stylesheet" href="menu.css"> + <script type="text/javascript" src="scripts/menu.js"></script> +</head> +<body> + +<div id="page"> +<!--#include virtual="menu.html.incl"--> +<div id="content"> + +<h1>CodeChecker: running the analyzer from the command line</h1> + +<h2>Basic Usage</h2> + +<p> +Analyze your project with the <tt>check</tt> command: +<pre class="code_example"> +CodeChecker check -b "cd ~/your-project && make clean && make" -o ~/results +</pre> +</p> + +<p> +The <tt>check</tt> command will print an overview of the issues found in your project by the analyzers. +</p> + +<p> +Start a CodeChecker web and storage server in another terminal or as a background process. By default it will listen on <tt>localhost:8001.</tt> +The SQLite database containing the reports will be placed in your workspace directory (<tt>~/.codechecker</tt> by default), which can be provided via the <tt>-w</tt> flag. +<pre class="code_example"> +CodeChecker server +</pre> +</p> + +<p> +Store your analysis reports onto the server to be able to use the Web Viewer. +<pre class="code_example"> +CodeChecker store ~/results -n my-project +</pre> +</p> + +<p> +To view the results, open the CodeChecker web viewer in your browser at <tt>localhost:8001</tt>, and you should be greeted with a web application showing you the analysis results. +<pre class="code_example"> +firefox localhost:8001 +</pre> +</p> + +<h2>Detailed Usage</h2> + +<p> +For extended documentation please refer to the <a href="https://github.com/Ericsson/codechecker">official site of CodeChecker</a>! +</p> +
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits