Run analysis passes on input programs. This is the primary command -- it ingests
input files, builds internal representations (CFG, call graph, pointer analysis),
runs the selected checkers, and produces findings.
saf run program.ll
saf run program.ll --mode fast
saf run program.ll --format sarif --output report.sarif
saf run program.ll --checkers memory-leak,null-deref --pta cspta --pta-k 2
Run incremental analysis with caching. Only recomputes what changed between runs.
saf incremental src/*.ll
saf incremental src/*.ll --cache-dir .saf-cache
saf incremental src/*.ll --plan
saf incremental src/*.ll --clean
saf incremental src/*.ll --export-summaries summaries.yaml
Option
Type
Default
Description
<inputs>
positional, required
Input files to analyze
--frontend <frontend>
llvm, air-json
llvm
Frontend to use for ingestion
--mode <mode>
sound, best-effort
best-effort
Precision mode for incremental analysis
--cache-dir <path>
path
.saf-cache
Cache directory for incremental state
--plan
flag
Dry-run: show what would be recomputed without running analysis
--clean
flag
Clear the cache before analysis
--export-summaries <path>
path
Export computed summaries as YAML to the given path
saf help # Overview of all commands and topics
saf help run # How to run analyses and configure passes
saf help checkers # Built-in bug checkers and how to select them
saf help pta # Pointer analysis variants and configuration
saf help typestate # Typestate checking and custom protocol specs
saf help taint # Taint analysis modes and configuration
saf help z3 # Z3-based path sensitivity and refinement
saf help export # Export targets, formats, and examples
saf help specs # Function specification format and discovery
saf help incremental # Incremental analysis and caching
saf help examples # Common usage patterns and recipes
# Run all checkers and output SARIF for GitHub Code Scanning
saf run program.ll --format sarif --output results.sarif
# Check exit code for pass/fail
if saf run program.ll --format json | jq '.findings | length' | grep -q '^0$'; then
echo "No findings"
else
echo "Findings detected"
exit 1
fi