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
This commit is contained in:
Justin Bogner
2014-04-23 21:44:55 +00:00
parent edcd7c718f
commit de2703ddfb
6 changed files with 46 additions and 10 deletions

View File

@ -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;
}