[llvm] r274028 - [llvm-cov] Minor cleanups (NFC)

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 09:12:20 PDT 2016


Author: vedantk
Date: Tue Jun 28 11:12:20 2016
New Revision: 274028

URL: http://llvm.org/viewvc/llvm-project?rev=274028&view=rev
Log:
[llvm-cov] Minor cleanups (NFC)

- Test the '-o' alias for -output-dir.
- Use a helper method in a conditional.
- Add a period.

Modified:
    llvm/trunk/test/tools/llvm-cov/showLineExecutionCounts.cpp
    llvm/trunk/tools/llvm-cov/CodeCoverage.cpp

Modified: llvm/trunk/test/tools/llvm-cov/showLineExecutionCounts.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/showLineExecutionCounts.cpp?rev=274028&r1=274027&r2=274028&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/showLineExecutionCounts.cpp (original)
+++ llvm/trunk/test/tools/llvm-cov/showLineExecutionCounts.cpp Tue Jun 28 11:12:20 2016
@@ -30,7 +30,7 @@ int main() {
 // RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -filename-equivalence -name=main %s | FileCheck -check-prefixes=CHECK,FILTER %s
 
 // Test -output-dir.
-// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -output-dir %t.dir -instr-profile %t.profdata -filename-equivalence %s
+// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -o %t.dir -instr-profile %t.profdata -filename-equivalence %s
 // RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -output-dir %t.dir -instr-profile %t.profdata -filename-equivalence -name=main %s
 // RUN: FileCheck -check-prefixes=CHECK,WHOLE-FILE -input-file %t.dir/coverage/tmp/showLineExecutionCounts.cpp.txt %s
 // RUN: FileCheck -check-prefixes=CHECK,FILTER -input-file %t.dir/functions.txt %s

Modified: llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CodeCoverage.cpp?rev=274028&r1=274027&r2=274028&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CodeCoverage.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CodeCoverage.cpp Tue Jun 28 11:12:20 2016
@@ -437,7 +437,7 @@ int CodeCoverageTool::show(int argc, con
   ViewOpts.Format = Format;
   ViewOpts.ShowOutputDirectory = ShowOutputDirectory;
 
-  if (ViewOpts.ShowOutputDirectory != "") {
+  if (ViewOpts.hasOutputDirectory()) {
     if (auto E = sys::fs::create_directories(ViewOpts.ShowOutputDirectory)) {
       error("Could not create output directory!", E.message());
       return 1;
@@ -479,7 +479,7 @@ int CodeCoverageTool::show(int argc, con
   bool ShowFilenames = SourceFiles.size() != 1;
 
   if (SourceFiles.empty())
-    // Get the source files from the function coverage mapping
+    // Get the source files from the function coverage mapping.
     for (StringRef Filename : Coverage->getUniqueSourceFiles())
       SourceFiles.push_back(Filename);
 




More information about the llvm-commits mailing list