From be6e5162f90ad684c145ff06e2bc95dccf9efd37 Mon Sep 17 00:00:00 2001
From: Ted Kremenek This documents provides some notes on using the LLVM/clang static analyzer
-to find bugs in C and Objective-C programs. Please note that this tool is very
-earlier in development, and there are many planned enhancements to improve both
-the analysis precision of the tool and the number of bugs it will find. This documents provides some notes on using the LLVM/clang static analyzer to
+find bugs in C and Objective-C programs. Please note that this tool is very early in development, and there are
+many planned enhancements to improve both the precision and scope of its
+analysis algorithms as well as the kinds bugs it will find. This document is arranged into the following sections:Information on using the Static Analyzer ("LLVM Checker")
-
Semi-regular builds of the analyzer on Mac OS X (10.5) are available Using the analyzer involves executing scan-build (see Basic Usage). scan-build will first look for a +clang executable in the same directory as scan-build, and then +search your path.
+ +If one is using the analyzer directly from the Clang sources, it suffices to +just directly execute scan-build in the utils directory. No +other special installation is needed.
+ +Semi-regular builds of the analyzer on Mac OS X (10.5) are available here. Packaged builds for other platforms may eventually be provided, but as the tool is in its early -stages we are not actively promoting releases yet.
+stages we are not actively promoting releases yet. If you wish to help +contribute regular builds of the analyzer on other platforms, please email the +Clang Developers' +mailing list. -Packaged builds consist of a few files from the Clang source tree, meaning -that anyone who can build Clang can use the static analyzer. The packaged -builds of the analyzer expand to the following files that are taken from the -utils and Driver subdirectories in the Clang tree:
+Packaged builds of the analyzer expand to the following files:
-File | Purpose |
scan-build | Script for running the analyzer over a project build. This is the only file you care about. |
ccc-analyzer | GCC interceptor (called by scan-build) |
sorttable.js | JavaScript used for displaying error reports |
Using the analyzer involves executing scan-build (see Basic Usage). scan-build will first look for a -clang executable in the same directory as scan-build, and then -search your path. If one is using the analyzer directly from the Clang sources, -it suffices to just directly execute scan-build in the utils -directory. No other special installation is needed.
+Packaged builds simply consist of a few files from the Clang source tree, +meaning that anyone who can build Clang can use the static analyzer. +Please see the Getting Started page for more +details on downloading and compiling Clang.
+ +All files used by the analyzer (and included in packaged builds; see above) other than a compiled clang executable +are found in the utils subdirectory in the Clang tree.
Option | Description | ||||
-a | +The analysis to run. The default analysis is checker-cfref. Valid options are: checker-cfref, fsyntax-only. + These translate into options passed down to the clang executable, and currently this option is mainly used for debugging. | ||||
-o | Target directory for HTML report files. Subdirectories will be created as needed to represent separate "runs" of the analyzer. If this option is not specified, a directory is created in /tmp to store the @@ -137,7 +158,7 @@ reports. | ||||
-v | Verbose output from scan-build and the analyzer. A second
+ -v | Verbose output from scan-build and the analyzer. A second and third
"-v" increases verbosity, and is useful for filing bug reports against the analyzer. | -V | View analysis results in a web browser when the build command completes. | Filing BugsWe encourage users to file bug reports for any problems that they encounter. -Apple-internal users should file bugs in Radar against the llvm - clang -component. External-Apple users should file bugs in LLVM's Bugzilla against -clang. + +Outside Apple: Please file bugs (against +Clang) in LLVM's Bugzilla database. + +Apple-internal: Please file bugs in Radar against the llvm - clang +component. + + |