[llvm-pdbdump] Remove unused variables.
[oota-llvm.git] / tools / llvm-cov / CodeCoverage.cpp
index feaa3fcd857213a5b412ba2e749be78417989442..cf8ab3377979aab5bf2886fca7e69aecfb1863e3 100644 (file)
@@ -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;
 }