From de2703ddfb7730fcfaf718f89b1561a539240a72 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 23 Apr 2014 21:44:55 +0000 Subject: 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 --- tools/llvm-cov/llvm-cov.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tools/llvm-cov/llvm-cov.cpp') 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 BranchCount("c", cl::Grouping, cl::init(false), "of percentages (requires -b)")); static cl::alias BranchCountA("branch-counts", cl::aliasopt(BranchCount)); +static cl::opt 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 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; } -- cgit v1.2.3