diff options
author | Justin Bogner <mail@justinbogner.com> | 2014-04-23 21:44:55 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2014-04-23 21:44:55 +0000 |
commit | de2703ddfb7730fcfaf718f89b1561a539240a72 (patch) | |
tree | b4b9e4885dc9f8fc282680137e148396b3d224ff /tools/llvm-cov/llvm-cov.cpp | |
parent | edcd7c718f9312d3ca6d3501d8b844760b648cd3 (diff) | |
download | llvm-de2703ddfb7730fcfaf718f89b1561a539240a72.tar.gz llvm-de2703ddfb7730fcfaf718f89b1561a539240a72.tar.bz2 llvm-de2703ddfb7730fcfaf718f89b1561a539240a72.tar.xz |
llvm-cov: Add support for gcov's --long-file-names option
GCOV provides an option to prepend output file names with the source
file name, to disambiguate between covered data that's included from
multiple sources. Add a flag to llvm-cov that does the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-cov/llvm-cov.cpp')
-rw-r--r-- | tools/llvm-cov/llvm-cov.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/llvm-cov/llvm-cov.cpp b/tools/llvm-cov/llvm-cov.cpp index 8e2cf95153..02f4b72216 100644 --- a/tools/llvm-cov/llvm-cov.cpp +++ b/tools/llvm-cov/llvm-cov.cpp @@ -39,6 +39,10 @@ static cl::opt<bool> BranchCount("c", cl::Grouping, cl::init(false), "of percentages (requires -b)")); static cl::alias BranchCountA("branch-counts", cl::aliasopt(BranchCount)); +static cl::opt<bool> LongNames("l", cl::Grouping, cl::init(false), + cl::desc("Prefix filenames with the main file")); +static cl::alias LongNamesA("long-file-names", cl::aliasopt(LongNames)); + static cl::opt<bool> FuncSummary("f", cl::Grouping, cl::init(false), cl::desc("Show coverage for each function")); static cl::alias FuncSummaryA("function-summaries", cl::aliasopt(FuncSummary)); @@ -126,9 +130,9 @@ int main(int argc, char **argv) { GF.dump(); GCOVOptions Options(AllBlocks, BranchProb, BranchCount, FuncSummary, - PreservePaths, UncondBranch); + PreservePaths, UncondBranch, LongNames); FileInfo FI(Options); GF.collectLineCounts(FI); - FI.print(InputGCNO, InputGCDA); + FI.print(SourceFile, InputGCNO, InputGCDA); return 0; } |