summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2019-02-19 20:45:00 +0000
committerVedant Kumar <vsk@apple.com>2019-02-19 20:45:00 +0000
commita0b97254797873b69ad5087ef748aebcf4426db8 (patch)
tree48122189823617ac729b4abd4c93d0bd35511182 /llvm/include
parent069af04a4a3855bd0b7d7f1bdad8a0d8bb10db85 (diff)
downloadbcm5719-llvm-a0b97254797873b69ad5087ef748aebcf4426db8.tar.gz
bcm5719-llvm-a0b97254797873b69ad5087ef748aebcf4426db8.zip
[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 llvm-svn: 354379
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ProfileData/GCOV.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/include/llvm/ProfileData/GCOV.h b/llvm/include/llvm/ProfileData/GCOV.h
index 27b76b577c1..9e2d27f083f 100644
--- a/llvm/include/llvm/ProfileData/GCOV.h
+++ b/llvm/include/llvm/ProfileData/GCOV.h
@@ -44,9 +44,10 @@ enum GCOVVersion { V402, V404, V704 };
/// A struct for passing gcov options between functions.
struct Options {
- Options(bool A, bool B, bool C, bool F, bool P, bool U, bool L, bool N)
+ Options(bool A, bool B, bool C, bool F, bool P, bool U, bool L, bool N, bool X)
: AllBlocks(A), BranchInfo(B), BranchCount(C), FuncCoverage(F),
- PreservePaths(P), UncondBranch(U), LongFileNames(L), NoOutput(N) {}
+ PreservePaths(P), UncondBranch(U), LongFileNames(L), NoOutput(N),
+ HashFilenames(X) {}
bool AllBlocks;
bool BranchInfo;
@@ -56,6 +57,7 @@ struct Options {
bool UncondBranch;
bool LongFileNames;
bool NoOutput;
+ bool HashFilenames;
};
} // end namespace GCOV
OpenPOWER on IntegriCloud