[llvm] r276404 - [llvm-cov] - Improve llvm-cov error message

Ying Yi via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 03:52:21 PDT 2016


Author: yingyi
Date: Fri Jul 22 05:52:21 2016
New Revision: 276404

URL: http://llvm.org/viewvc/llvm-project?rev=276404&view=rev
Log:
[llvm-cov] - Improve llvm-cov error message

Summary:

When giving the following command:
% llvm-cov report -instr-profile=default.profraw

llvm-cov will give the following error message:

>llvm-cov report: Not enough positional command line arguments specified!
>Must specify at least 1 positional arguments: See: orbis-llvm-cov report -help

This patch changes the error message from  '1 positional arguments'
to '1 positional argument'.

Differential Revision: https://reviews.llvm.org/D22621

Modified:
    llvm/trunk/lib/Support/CommandLine.cpp
    llvm/trunk/test/tools/llvm-cov/universal-binary.c

Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=276404&r1=276403&r2=276404&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Fri Jul 22 05:52:21 2016
@@ -1211,7 +1211,8 @@ bool CommandLineParser::ParseCommandLine
       errs() << ProgramName
              << ": Not enough positional command line arguments specified!\n"
              << "Must specify at least " << NumPositionalRequired
-             << " positional arguments: See: " << argv[0] << " -help\n";
+             << " positional argument" << (NumPositionalRequired > 1 ? "s" : "")
+             << ": See: " << argv[0] << " - help\n";
     }
 
     ErrorParsing = true;

Modified: llvm/trunk/test/tools/llvm-cov/universal-binary.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/universal-binary.c?rev=276404&r1=276403&r2=276404&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/universal-binary.c (original)
+++ llvm/trunk/test/tools/llvm-cov/universal-binary.c Fri Jul 22 05:52:21 2016
@@ -8,3 +8,6 @@ int main(int argc, const char *argv[]) {
 
 // RUN: not llvm-cov show %S/Inputs/universal-binary -instr-profile %t.profdata -filename-equivalence %s -arch i386 2>&1 | FileCheck --check-prefix=WRONG-ARCH %s
 // WRONG-ARCH: Failed to load coverage
+
+// RUN: not llvm-cov report -instr-profile %t.profdata 2>&1 | FileCheck --check-prefix=MISSING-BINARY %s
+// MISSING-BINARY: 1 positional argument: See:




More information about the llvm-commits mailing list