[gcov] Add -i --intermediate-format
authorFangrui Song <maskray@google.com>
Tue, 16 Jun 2020 21:13:51 +0000 (14:13 -0700)
committerFangrui Song <maskray@google.com>
Tue, 16 Jun 2020 21:14:28 +0000 (14:14 -0700)
commitdef21563895d757c7769de41d4ee8d9cb99714db
treeeaf8fe86878df57b69c428ce8c233b3df725f21d
parent4cd7ba7eca194feccc80413d3b8021ebd03a4f2d
[gcov] Add -i --intermediate-format

Between gcov 4.9~8, `gcov -i $file` prints coverage information to
$file.gcov in an intermediate text format (single file, instead of
$source.gcov for each source file).

lcov newer than 2019-05-24 detects -i support and uses it to increase
processing speed.  gcov 9 (GCC r265587) removed --intermediate-format
and -i was changed to mean --json-format. However, we consider this
format still useful and support it. geninfo (part of lcov) supports this
format even if we announce that we are compatible with gcov 9.0.0
llvm/include/llvm/ProfileData/GCOV.h
llvm/lib/ProfileData/GCOV.cpp
llvm/test/tools/llvm-cov/gcov-8.c
llvm/test/tools/llvm-cov/gcov-intermediate-format.test [new file with mode: 0644]
llvm/tools/llvm-cov/gcov.cpp