Retry: [llvm-cov] Add support for exporting coverage data to JSON
authorVedant Kumar <vsk@apple.com>
Tue, 26 Jul 2016 22:50:58 +0000 (22:50 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 26 Jul 2016 22:50:58 +0000 (22:50 +0000)
commit7101d73c71ec9dd53b092ed354357ac5a2e1d34c
tree4f88f6e828ff7d8c27f4916cf4cf7cc1f4712f30
parenta333db87a7190408cf3f6ab5cc769a19ebe40e33
Retry: [llvm-cov] Add support for exporting coverage data to JSON

This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Changes since the initial commit (r276813):

  - Fixed the regexes in the tests to handle Windows filepaths.

Patch by Eddie Hurtig!

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

llvm-svn: 276818
17 files changed:
llvm/docs/CommandGuide/llvm-cov.rst
llvm/test/tools/llvm-cov/Inputs/binary-formats.canonical.json [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/highlightedRanges.json [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/lineExecutionCounts.json [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/regionMarkers.json [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/showExpansions.json [new file with mode: 0644]
llvm/test/tools/llvm-cov/Inputs/universal-binary.json [new file with mode: 0644]
llvm/test/tools/llvm-cov/binary-formats.c
llvm/test/tools/llvm-cov/showExpansions.cpp
llvm/test/tools/llvm-cov/showHighlightedRanges.cpp
llvm/test/tools/llvm-cov/showLineExecutionCounts.cpp
llvm/test/tools/llvm-cov/showRegionMarkers.cpp
llvm/test/tools/llvm-cov/universal-binary.c
llvm/tools/llvm-cov/CMakeLists.txt
llvm/tools/llvm-cov/CodeCoverage.cpp
llvm/tools/llvm-cov/CoverageExporterJson.cpp [new file with mode: 0644]
llvm/tools/llvm-cov/llvm-cov.cpp