LLVM has a nifty linter which checks for some common kinds of unusual or
undefined behavior by doing some basic IR-level static analysis.
Add a CC1 option to clang which enables this analysis.
Having the linter available through clang could be a useful debugging
tool. It can also be a useful reporting tool: hacking your build system
to add in "-Xclang -enable-llvm-linter" is usually easier than hacking
it to add "$CC ... | opt -S -o /dev/null -lint".
Eventually, I'd like to teach the linter about the sanitizers, so that
it can statically report the kinds of bugs the sanitizers know how to
flag. This would work by checking for diagnostic calls which post-dom
function entry blocks (unconditionally buggy code). The research paper
on the STACK static UB checker suggests that this could be useful.