[PATCH] Add scan-build python implementation

Devin Coughlin dcoughlin at apple.com
Mon Jun 8 17:20:54 PDT 2015

I've spoken with Ted Kremenek, Anna Zaks, and Jordan Rose about your patch. We're very excited about your python reimplementation. We think it can serve as a solid foundation for potential future improvements to scan-build, including better HTML output for diagnostics crossing multiple files and more scalable handling of files with multiple diagnostics. At the same time, we also want to make sure that we continue serving the needs of current users of the scan-build script, including those on Windows and those with complicated build systems not suited to the two-phase approach with a compilation database.

We think your modular design separating interception and analysis is a good start — but we’d like you to generalize the driver a little bit to be able to allow for the potential of different analysis methods. In particular, in addition to your workflow of "generate a compilation database and then run analysis using the database", we would like you to support an interposition mode that defers to the existing ccc-analyzer. This interposition would enable users on Windows and users with build systems that move or modify build system intermediates to use scan-build-py.

Before committing scan-build-py, we would like you to make sure that it:

- Supports a mode where it defers to ccc-analyzer.
- Works with large non-Xcode-based projects.
- Works with the SATestBuild.py script (in $CLANG_SOURCES_DIR/utils/analyzer/) (*).
- Does not require installation (the user should be able to have multiple clangs and should not need to use virtualenv, etc.).

(*) I can help with SATestBuild.py and would be happy to talk to you over Skype about getting it up and running on benchmarks.

Longer term, before we replace the current scan-build with scan-build-py, we also need to make sure that it:

- Works with xcodebuild.
- Works on Windows.
- Has command-line compatibility with the existing scan-build.
- Is integrated into the llvm/clang build system and testing infrastructure.



More information about the cfe-commits mailing list