[utils] Implement the llvm-locstats tool
authorDjordje Todorovic <djordje.todorovic@rt-rk.com>
Tue, 10 Sep 2019 13:47:03 +0000 (13:47 +0000)
committerDjordje Todorovic <djordje.todorovic@rt-rk.com>
Tue, 10 Sep 2019 13:47:03 +0000 (13:47 +0000)
commit54008972d17bf82ae36ccda7a2b20985c8a2821e
tree3853ac9307ca949b960c0ce52f3ebf4a43255e21
parent7dfd0fb7f1cda3525d9c2fbdf680391b73479031
[utils] Implement the llvm-locstats tool

The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

The tool will be very useful for tracking improvements regarding the
"debugging optimized code" support with LLVM ecosystem.

Differential Revision: https://reviews.llvm.org/D66526

llvm-svn: 371520
llvm/CMakeLists.txt
llvm/docs/CommandGuide/index.rst
llvm/docs/CommandGuide/llvm-locstats.rst [new file with mode: 0644]
llvm/test/tools/llvm-dwarfdump/X86/locstats.ll
llvm/utils/llvm-locstats/CMakeLists.txt [new file with mode: 0644]
llvm/utils/llvm-locstats/llvm-locstats.py [new file with mode: 0755]