OSDN Git Service

[llvm-cov] Add support for gcov --hash-filenames option
authorVedant Kumar <vsk@apple.com>
Tue, 19 Feb 2019 20:45:00 +0000 (20:45 +0000)
committerVedant Kumar <vsk@apple.com>
Tue, 19 Feb 2019 20:45:00 +0000 (20:45 +0000)
commit0503e22ae30b5bbdcc98d583bb18c81601db3431
tree13b1d4af45f12a94085cb2795d0208b55dd4e6cb
parent6e8fe0619d71529b8f132ff5bc4704d3a8484e6c
[llvm-cov] Add support for gcov --hash-filenames option

The patch adds support for --hash-filenames to llvm-cov. This option adds md5
hash of the source path to the name of the generated .gcov file. The option is
crucial for cases where you have multiple files with the same name but can't
use --preserve-paths as resulting filenames exceed the limit.

from gcov(1):

```
-x
--hash-filenames
    By default, gcov uses the full pathname of the source files to to
    create an output filename.  This can lead to long filenames that
    can overflow filesystem limits.  This option creates names of the
    form source-file##md5.gcov, where the source-file component is
    the final filename part and the md5 component is calculated from
    the full mangled name that would have been used otherwise.
```

Patch by Igor Ignatev!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354379 91177308-0d34-0410-b5e6-96231b3b80d8
docs/CommandGuide/llvm-cov.rst
include/llvm/ProfileData/GCOV.h
lib/ProfileData/GCOV.cpp
test/tools/llvm-cov/Inputs/test_hash.output [new file with mode: 0644]
test/tools/llvm-cov/llvm-cov.test
tools/llvm-cov/gcov.cpp