summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/CodeCoverage.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-02-14 02:05:05 +0000
committerJustin Bogner <mail@justinbogner.com>2015-02-14 02:05:05 +0000
commit0ef7a2a2506ee1107ab24ac566ba7d3f3aa20c2d (patch)
treeec01881aa2e78835a84470882ae80fde4392ee17 /llvm/tools/llvm-cov/CodeCoverage.cpp
parentd76078f81b872966e433653780eeba623058ff1b (diff)
downloadbcm5719-llvm-0ef7a2a2506ee1107ab24ac566ba7d3f3aa20c2d.tar.gz
bcm5719-llvm-0ef7a2a2506ee1107ab24ac566ba7d3f3aa20c2d.zip
llvm-cov: Actually use the command line arguments when reporting
This code didn't really make sense as is. If a filename is passed in, the user obviously wants the coverage *for that file*, not *for everything*. llvm-svn: 229217
Diffstat (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r--llvm/tools/llvm-cov/CodeCoverage.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index feaa3fcd857..cf8ab337797 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -324,10 +324,11 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) {
for (const auto &File : InputSourceFiles) {
SmallString<128> Path(File);
- if (std::error_code EC = sys::fs::make_absolute(Path)) {
- errs() << "error: " << File << ": " << EC.message();
- return 1;
- }
+ if (!CompareFilenamesOnly)
+ if (std::error_code EC = sys::fs::make_absolute(Path)) {
+ errs() << "error: " << File << ": " << EC.message();
+ return 1;
+ }
SourceFiles.push_back(Path.str());
}
return 0;
@@ -459,12 +460,10 @@ int CodeCoverageTool::report(int argc, const char **argv,
return 1;
CoverageReport Report(ViewOpts, std::move(Coverage));
- if (SourceFiles.empty() && Filters.empty()) {
+ if (SourceFiles.empty())
Report.renderFileReports(llvm::outs());
- return 0;
- }
-
- Report.renderFunctionReports(llvm::outs());
+ else
+ Report.renderFunctionReports(SourceFiles, llvm::outs());
return 0;
}
OpenPOWER on IntegriCloud