Generated by GPT-5-mini| llvm-cov | |
|---|---|
| Name | llvm-cov |
| Developer | LLVM Project |
| Released | 2012 |
| Latest release | ongoing |
| Operating system | Linux, macOS, Windows |
| Programming language | C++ |
| License | UIUC License |
llvm-cov
llvm-cov is a coverage analysis tool distributed with the LLVM Project that visualizes and reports code coverage for programs instrumented by Clang and the LLVM coverage runtime. It integrates with compiler frontends such as Clang and build systems like CMake and Ninja to present line- and region-level coverage metrics alongside source listings or in web-friendly formats. Developers from projects such as Mozilla, Google, Apple Inc., Intel Corporation, and Facebook use LLVM tooling for coverage analysis and integration into continuous integration systems like Jenkins, Travis CI, GitLab CI, and GitHub Actions.
llvm-cov reads profiling data generated by the LLVM Coverage Mapping format and the runtime component llvm-profdata to produce annotated source views and summaries. The tool complements instrumentation frameworks like Sanitizer Coverage, gcov, and GCC tooling while aligning with ecosystem projects including LLDB, Clang Static Analyzer, AddressSanitizer, and ThreadSanitizer. Major users and contributors include organizations such as Google, Mozilla Foundation, Apple Inc., Intel Corporation, ARM Holdings, and academic groups from MIT, Stanford University, University of California, Berkeley, and ETH Zurich.
llvm-cov supports per-function and per-line coverage metrics, region granularity, and branch visibility for optimized builds. It provides HTML reports with inlined source annotations and summaries useful for teams at Red Hat, Canonical, Samsung Electronics, NVIDIA, and Microsoft. Advanced features include support for cross-module coverage, merged profiles using llvm-profdata, and filtering by file or symbol lists similar to workflows used by Chromium, Firefox, LibreOffice, KDE, and GNOME. Integration with code-review tools like Gerrit, Phabricator, and Review Board is feasible via the JSON output used in automation pipelines for projects such as LLVM, Chromium OS, Android Open Source Project, and OpenBSD.
Common invocation patterns mirror those used by CI engineers at Google and Mozilla, combining llvm-cov show with llvm-profdata to merge and display data. Typical flags include options to select report formats, specify source search paths, and toggle demangling for symbols produced by libc++, libstdc++, and Boost. Command-line integration is common in environments using Bazel, Meson, Autotools, and Buck, enabling automation in repositories maintained by Google, Facebook, Dropbox, and Salesforce. Options for filtering, output directories, and branch coverage mimic interfaces seen in gcovr and coverage.py workflows used at Python Software Foundation projects.
llvm-cov is designed to work seamlessly with Clang instrumentation flags and the LLVM coverage runtime, cooperating with llvm-profdata to merge raw profiles. Build systems such as CMake, Ninja, Bazel, Meson, SCons, and Make commonly incorporate coverage targets to instrument, run, and collect data for projects hosted on platforms like GitHub, GitLab, Bitbucket, and SourceForge. Large-scale integrations in projects like Chromium, LLVM, Kubernetes, Docker, and OpenSSL use wrappers and scripts to coordinate compilation with coverage flags and postprocessing with llvm-cov and third-party dashboards such as Codecov and Coveralls.
llvm-cov can emit annotated source listings, per-file summaries, and JSON suitable for ingestion by web services and dashboards used by companies like Codecov, Coveralls, SonarSource, and Code Climate. HTML output supports syntax highlighting consistent with editors and tools such as Visual Studio Code, Vim, Emacs, Xcode, and CLion. The JSON schema enables integration with analytics stacks including Elasticsearch, Kibana, Grafana, and CI visualization solutions in Jenkins and TeamCity. The tool’s reports often pair with test frameworks like Google Test, Catch2, Boost.Test, JUnit, and pytest for per-test coverage correlation in projects at Intel Corporation, AMD, ARM, and prominent open-source repositories.
Implemented in C++, llvm-cov consumes coverage mapping records produced by frontends such as Clang and uses data files in the format generated by llvm-profdata (which reads raw profiles produced by the LLVM runtime). Its architecture interacts with LLVM components including the LLVM IR, CodeGen, and symbol tables produced by linkers like GNU ld and gold as well as LLD. The frontend/backends and instrumentation hooks are analogous to mechanisms in GCC’s gcov while leveraging LLVM-specific projects like LLVM Coverage Mapping, CoverageInstrumentation, and the LLVM Pass Manager. Performance characteristics reflect design decisions similar to those in LLVM subsystems used by large vendors such as Google and Apple Inc..
llvm-cov excels for projects compiling with Clang and using LLVM’s coverage runtime but has limitations when applied to binaries produced by GCC or languages without Clang frontends. Compared to gcov and lcov, llvm-cov provides richer mapping for optimized code and inlined functions but may require additional tooling for per-test attribution compared with language-specific tools like coverage.py (Python) or Istanbul (JavaScript). Integrations offered by commercial services like Codecov and Coveralls often provide extra dashboards and retention policies, while llvm-cov remains focused on accurate, compiler-level coverage suitable for systems software projects such as LLVM, Chromium, Linux kernel developers, and projects maintained at Mozilla.
Category:Software