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 | c67f0250ef817ae4d3c749c82cf8de2e2eac5c99 (patch) | |
tree | 1a903bef4a7d5e79d89bdd34852987a468f0272c /llvm/tools/llvm-cov/llvm-cov.cpp | |
parent | bac905c684f734c4a110acd0b94deacb29b5a475 (diff) | |
download | bcm5719-llvm-c67f0250ef817ae4d3c749c82cf8de2e2eac5c99.tar.gz bcm5719-llvm-c67f0250ef817ae4d3c749c82cf8de2e2eac5c99.zip |
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.
llvm-svn: 207035
Diffstat (limited to 'llvm/tools/llvm-cov/llvm-cov.cpp')
-rw-r--r-- | llvm/tools/llvm-cov/llvm-cov.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/llvm-cov.cpp b/llvm/tools/llvm-cov/llvm-cov.cpp index 8e2cf95153d..02f4b722169 100644 --- a/llvm/tools/llvm-cov/llvm-cov.cpp +++ b/llvm/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; } |