[llvm-dwarfdump][LineCov 1/3] Add variable coverage metrics (#176725) Patch 1 of 3 to add to llvm-dwarfdump the ability to measure DWARF coverage of local variables in terms of source lines, as discussed in [this RFC](https://discourse.llvm.org/t/rfc-debug-info-coverage-tool-v2/83266). This patch adds the basic variable coverage implementation. By default, inlined instances are shown separately (displaying the full inlining chain). Alternatively, a combined view that averages across all inlined instances can be returned using `--combine-instances`. In this patch, we simply print a count of source lines over which each variable is covered. Later patches in the series will add the comparison against a baseline. Example output: ``` $ llvm-dwarfdump --show-variable-coverage somefile Variable coverage statistics: Function InlChain Variable Decl LinesCovered foo bar path/to/somefile.h:54 3 foo path/to/someotherfile.c:32 bar path/to/somefile.h:54 2 foo baz main.c:76 9 ``` ``` $ llvm-dwarfdump --show-variable-coverage somefile --combine-instances Variable coverage statistics: Function InstanceCount Variable Decl LinesCovered foo 2 bar path/to/somefile.h:54 2.5 foo 1 baz main.c:76 9 ``` This reapplies #169646, fixing some ambiguous overloads that caused several bots to fail.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.