Similar to clang's -verify option, this parses comments in the source containing expected diagnostics, and checks that the emitted diagnostics match them. It is intended to be used in tests in the same way as the clang option.
I haven't been able to share any code other than the ParseHelper class with the clang implementation, because clang uses it's own source manager and diagnostic classes, which are different from LLVM's.