diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-02-04 10:45:02 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-02-04 10:45:02 +0000 |
commit | 01c05505841940a899fbfd3e214b5d3214d80ef6 (patch) | |
tree | ca02f24ac0384d572f18007daf01d5b3339caf91 /include | |
parent | 284c931330404e61d548fc1eedf44d5dd1b87507 (diff) | |
download | llvm-01c05505841940a899fbfd3e214b5d3214d80ef6.tar.gz llvm-01c05505841940a899fbfd3e214b5d3214d80ef6.tar.bz2 llvm-01c05505841940a899fbfd3e214b5d3214d80ef6.tar.xz |
llvm-cov: Implement the preserve-paths flag
Until now, when a path in a gcno file included a directory, we would
emit our .gcov file in that directory, whereas gcov always emits the
file in the current directory. In doing so, this implements gcov's
strange name-mangling -p flag, which is needed to avoid clobbering
files when two with the same name exist in different directories.
The path mangling is a bit ugly and only handles unix-like paths, but
it's simple, and it doesn't make any guesses as to how it should
behave outside of what gcov documents. If we decide this should be
cross platform later, we can consider the compatibility implications
then.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/GCOV.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/include/llvm/Support/GCOV.h b/include/llvm/Support/GCOV.h index 4e7920b8e9..aeac4555ce 100644 --- a/include/llvm/Support/GCOV.h +++ b/include/llvm/Support/GCOV.h @@ -37,14 +37,15 @@ namespace GCOV { /// GCOVOptions - A struct for passing gcov options between functions. struct GCOVOptions { - GCOVOptions(bool A, bool B, bool C, bool F, bool U) : - AllBlocks(A), BranchInfo(B), BranchCount(C), FuncCoverage(F), UncondBranch(U) - {} + GCOVOptions(bool A, bool B, bool C, bool F, bool P, bool U) + : AllBlocks(A), BranchInfo(B), BranchCount(C), FuncCoverage(F), + PreservePaths(P), UncondBranch(U) {} bool AllBlocks; bool BranchInfo; bool BranchCount; bool FuncCoverage; + bool PreservePaths; bool UncondBranch; }; @@ -401,8 +402,13 @@ private: StringMap<LineData> LineInfo; uint32_t RunCount; uint32_t ProgramCount; - SmallVector<GCOVCoverage, 4> FileCoverages; - MapVector<const GCOVFunction *, GCOVCoverage> FuncCoverages; + + typedef SmallVector<std::pair<std::string, GCOVCoverage>, 4> + FileCoverageList; + typedef MapVector<const GCOVFunction *, GCOVCoverage> FuncCoverageMap; + + FileCoverageList FileCoverages; + FuncCoverageMap FuncCoverages; }; } |