This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cov] Add support for gcov --hash-filenames option.
ClosedPublic

Authored by iignatev on Feb 18 2019, 10:15 PM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

iignatev created this revision.Feb 18 2019, 10:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2019, 10:15 PM
iignatev updated this revision to Diff 187315.Feb 18 2019, 11:24 PM

forgot to add test/tools/llvm-cov/Inputs/test_hash.output

vsk accepted this revision.Feb 19 2019, 10:49 AM
vsk added a subscriber: vsk.

Hi @iignatev, thanks for the patch. LGTM.

In the future you might get a faster review by setting assigning a few reviewers on Phab (typically, the last few people who've touched the code).

docs/CommandGuide/llvm-cov.rst
156 ↗(On Diff #187315)

nit, calculated

This revision is now accepted and ready to land.Feb 19 2019, 10:49 AM
iignatev updated this revision to Diff 187413.Feb 19 2019, 11:02 AM

Hi @vsk,

thanks for your review. I've uploaded the patch w/ the typo in llvm-cov.rst fixed. as I don't have commit access, could you please help me w/ integration of this patch?

In the future you might get a faster review by setting assigning a few reviewers on Phab (typically, the last few people who've touched the code).

thanks for the tip, will definitely do next time.

This revision was automatically updated to reflect the committed changes.