Request for local llvm source code coverage for developers


This request is related to a previous thread titled ‘A new code coverage bot’ (

“The purpose of the bot is to make high-quality coverage reports available to

llvm developers, and to provide additional testing for clang’s code coverage


I am wondering if there is a framework in place to get the code coverage information locally.

I have to get code coverage information of a llvm development branch which resides on my local machine. I also need to get the coverage numbers by running my own set of test suites.

Thanks and Best Regards


Hi Arvind,

You can use “llvm/utils/” to generate coverage reports. Here’s how:

  1. Build llvm with coverage reporting enabled.
  2. Collect profiles by running tests.
  3. Use in “–only-merge” mode to merge your profiles together.
  4. Use again to emit an html report, passing in “–use-existing-profdata path/to/merged/profile”.
    If you need coverage reporting for multiple binaries, pass in the paths to the binaries you’re interested in, along with the “–unified-report” option.
    If you only want coverage for a particular set of files or directories, you can specify this with the “–restrict” option.