[llvm] r371912 - [llvm-ar] Uncapitalize error messages and delete full stop

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 18:18:47 PDT 2019


Author: maskray
Date: Fri Sep 13 18:18:47 2019
New Revision: 371912

URL: http://llvm.org/viewvc/llvm-project?rev=371912&view=rev
Log:
[llvm-ar] Uncapitalize error messages and delete full stop

Most GNU binutils don't append full stops in error messages. This
convention has been adopted by a bunch of LLVM binary utilities. Make
llvm-ar follow the convention as well.

Reviewed By: grimar

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

Modified:
    llvm/trunk/test/Object/archive-extract.test
    llvm/trunk/test/Object/archive-format.test
    llvm/trunk/test/Object/archive-update.test
    llvm/trunk/test/Object/mri2.test
    llvm/trunk/test/Object/mri3.test
    llvm/trunk/test/Object/mri4.test
    llvm/trunk/test/Object/mri5.test
    llvm/trunk/test/tools/llvm-ar/count.test
    llvm/trunk/test/tools/llvm-ar/insert-after.test
    llvm/trunk/test/tools/llvm-ar/insert-before.test
    llvm/trunk/test/tools/llvm-ar/invalid-command-line.test
    llvm/trunk/test/tools/llvm-ar/move-after.test
    llvm/trunk/test/tools/llvm-ar/move-before.test
    llvm/trunk/test/tools/llvm-ar/move.test
    llvm/trunk/test/tools/llvm-ar/mri-addlib.test
    llvm/trunk/test/tools/llvm-ar/print.test
    llvm/trunk/test/tools/llvm-ar/quick-append.test
    llvm/trunk/test/tools/llvm-ar/read-only-archive.test
    llvm/trunk/test/tools/llvm-ar/replace.test
    llvm/trunk/tools/llvm-ar/llvm-ar.cpp

Modified: llvm/trunk/test/Object/archive-extract.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/archive-extract.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/Object/archive-extract.test (original)
+++ llvm/trunk/test/Object/archive-extract.test Fri Sep 13 18:18:47 2019
@@ -58,4 +58,4 @@ RUN: llvm-ar p %p/Inputs/thin.a evenlen
 EVENLEN: evenlen
 
 RUN: not llvm-ar p %p/Inputs/thin-path.a t/test2.o 2>&1 | FileCheck %s --check-prefix=MISSING
-MISSING: {{N|n}}o such file or directory.
+MISSING: error: {{N|n}}o such file or directory

Modified: llvm/trunk/test/Object/archive-format.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/archive-format.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/Object/archive-format.test (original)
+++ llvm/trunk/test/Object/archive-format.test Fri Sep 13 18:18:47 2019
@@ -76,7 +76,7 @@ THIN-PATH-NEXT: /41             0
 THIN-PATH-NEXT: /65             0           0     0     644     4         `
 
 RUN: not llvm-ar --format=bsd rcT bad.a 0123456789abcde 0123456789abcdef 2>&1 | FileCheck --check-prefix=BSD-THIN %s
-BSD-THIN: Only the gnu format has a thin mode.
+BSD-THIN: error: only the gnu format has a thin mode
 
 If an archive has an object with no symbols, the linker and some other
 tools on some versions of Solaris will abort operations if there is no

Modified: llvm/trunk/test/Object/archive-update.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/archive-update.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/Object/archive-update.test (original)
+++ llvm/trunk/test/Object/archive-update.test Fri Sep 13 18:18:47 2019
@@ -48,4 +48,4 @@ BOTH-FILES: bar
 RUN: rm -f %t/tmp.a
 RUN: llvm-ar --format=gnu rc %t/tmp.a foo
 RUN: not llvm-ar --format=gnu rcT %t/tmp.a bar 2>&1 | FileCheck --check-prefix=ERROR %s
-ERROR: Cannot convert a regular archive to a thin one.
+ERROR: error: cannot convert a regular archive to a thin one

Modified: llvm/trunk/test/Object/mri2.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/mri2.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/Object/mri2.test (original)
+++ llvm/trunk/test/Object/mri2.test Fri Sep 13 18:18:47 2019
@@ -4,4 +4,4 @@
 ; RUN: echo end >> %t.mri
 
 ; RUN: not llvm-ar -M  < %t.mri 2>&1 | FileCheck %s
-; CHECK: Editing multiple archives not supported
+; CHECK: error: editing multiple archives not supported

Modified: llvm/trunk/test/Object/mri3.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/mri3.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/Object/mri3.test (original)
+++ llvm/trunk/test/Object/mri3.test Fri Sep 13 18:18:47 2019
@@ -3,4 +3,4 @@
 ; RUN: echo end >> %t.mri
 
 ; RUN: not llvm-ar -M  < %t.mri 2>&1 | FileCheck %s
-; CHECK: File already saved.
+; CHECK: error: file already saved

Modified: llvm/trunk/test/Object/mri4.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/mri4.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/Object/mri4.test (original)
+++ llvm/trunk/test/Object/mri4.test Fri Sep 13 18:18:47 2019
@@ -1,4 +1,4 @@
 ; RUN: echo abc > %t.mri
 
 ; RUN: not llvm-ar -M  < %t.mri 2>&1 | FileCheck %s
-; CHECK: Unknown command: abc.
+; CHECK: error: unknown command: abc

Modified: llvm/trunk/test/Object/mri5.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/mri5.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/Object/mri5.test (original)
+++ llvm/trunk/test/Object/mri5.test Fri Sep 13 18:18:47 2019
@@ -1,2 +1,2 @@
 ; RUN: not llvm-ar -M t < %s 2>&1 | FileCheck %s
-; CHECK: Cannot mix -M and other options.
+; CHECK: error: cannot mix -M and other options

Modified: llvm/trunk/test/tools/llvm-ar/count.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/count.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/count.test (original)
+++ llvm/trunk/test/tools/llvm-ar/count.test Fri Sep 13 18:18:47 2019
@@ -31,9 +31,9 @@ RUN: not llvm-ar xN 4 %t/archive.a foo.t
 # N only applies to x/d.
 RUN: not llvm-ar rN 1 %t/archive.a foo.txt 2>&1 | FileCheck %s --check-prefix=ERR-BAD-OP
 
-ERR-NOT-NUM:   error: Value for [count] must be numeric
-ERR-NOT-POS:   error: Value for [count] must be positive
-ERR-BAD-OP:    error: The 'N' modifier can only be specified with the 'x' or 'd' operations
+ERR-NOT-NUM:   error: value for [count] must be numeric
+ERR-NOT-POS:   error: value for [count] must be positive
+ERR-BAD-OP:    error: the 'N' modifier can only be specified with the 'x' or 'd' operations
 ERR-NOT-FOUND: error: 'foo.txt' was not found
 
 # Extract individual items.

Modified: llvm/trunk/test/tools/llvm-ar/insert-after.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/insert-after.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/insert-after.test (original)
+++ llvm/trunk/test/tools/llvm-ar/insert-after.test Fri Sep 13 18:18:47 2019
@@ -43,7 +43,7 @@ RUN: not llvm-ar ra invalid.txt %t-inval
 RUN:   | FileCheck %s --check-prefix=ERROR
 RUN: llvm-ar t %t-invalid.a | FileCheck %s --check-prefix=INVALID
 
-ERROR: error: Insertion point not found.
+ERROR: error: insertion point not found
 INVALID:      1.txt
 INVALID-NEXT: 2.txt
 INVALID-NEXT: 3.txt

Modified: llvm/trunk/test/tools/llvm-ar/insert-before.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/insert-before.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/insert-before.test (original)
+++ llvm/trunk/test/tools/llvm-ar/insert-before.test Fri Sep 13 18:18:47 2019
@@ -43,7 +43,7 @@ RUN: not llvm-ar rb invalid.txt %t-inval
 RUN:   | FileCheck %s --check-prefix=ERROR
 RUN: llvm-ar t %t-invalid.a | FileCheck %s --check-prefix=INVALID
 
-ERROR: error: Insertion point not found.
+ERROR: error: insertion point not found
 INVALID:      1.txt
 INVALID-NEXT: 2.txt
 INVALID-NEXT: 3.txt

Modified: llvm/trunk/test/tools/llvm-ar/invalid-command-line.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/invalid-command-line.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/invalid-command-line.test (original)
+++ llvm/trunk/test/tools/llvm-ar/invalid-command-line.test Fri Sep 13 18:18:47 2019
@@ -1,5 +1,5 @@
 Test that llvm-ar exits with 1 when there is an error.
 
 RUN: not llvm-ar e 2>&1 | FileCheck %s
-CHECK: unknown option e.
+CHECK: error: unknown option e
 CHECK: OVERVIEW: LLVM Archiver

Modified: llvm/trunk/test/tools/llvm-ar/move-after.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/move-after.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/move-after.test (original)
+++ llvm/trunk/test/tools/llvm-ar/move-after.test Fri Sep 13 18:18:47 2019
@@ -43,7 +43,7 @@ RUN: not llvm-ar ma invalid.txt %t-inval
 RUN:   | FileCheck %s --check-prefix=ERROR
 RUN: llvm-ar t %t-invalid.a | FileCheck %s --check-prefix=INVALID
 
-ERROR: error: Insertion point not found.
+ERROR: error: insertion point not found
 INVALID:      1.txt
 INVALID-NEXT: 2.txt
 INVALID-NEXT: 3.txt

Modified: llvm/trunk/test/tools/llvm-ar/move-before.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/move-before.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/move-before.test (original)
+++ llvm/trunk/test/tools/llvm-ar/move-before.test Fri Sep 13 18:18:47 2019
@@ -43,7 +43,7 @@ RUN: not llvm-ar mb invalid.txt %t-inval
 RUN:   | FileCheck %s --check-prefix=ERROR
 RUN: llvm-ar t %t-invalid.a | FileCheck %s --check-prefix=INVALID
 
-ERROR: error: Insertion point not found.
+ERROR: error: insertion point not found
 INVALID:      1.txt
 INVALID-NEXT: 2.txt
 INVALID-NEXT: 3.txt

Modified: llvm/trunk/test/tools/llvm-ar/move.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/move.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/move.test (original)
+++ llvm/trunk/test/tools/llvm-ar/move.test Fri Sep 13 18:18:47 2019
@@ -77,14 +77,14 @@
 # RUN: not llvm-ar m 2>&1 \
 # RUN:   | FileCheck %s --check-prefix=NO-ARCHIVE
 
-# NO-ARCHIVE: error: An archive name must be specified.
+# NO-ARCHIVE: error: an archive name must be specified
 
 ## Member does not exist:
 # RUN: llvm-ar rc %t/missing.a %t/1.o %t/2.o %t/3.o
 # RUN: not llvm-ar m %t/missing.a %t/missing.txt 2>&1 \
 # RUN:   | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt
 
-# MISSING-FILE: error: [[FILE]]: {{[nN]}}o such file or directory.
+# MISSING-FILE: error: [[FILE]]: {{[nN]}}o such file or directory
 
 --- !ELF
 FileHeader:

Modified: llvm/trunk/test/tools/llvm-ar/mri-addlib.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/mri-addlib.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/mri-addlib.test (original)
+++ llvm/trunk/test/tools/llvm-ar/mri-addlib.test Fri Sep 13 18:18:47 2019
@@ -22,7 +22,7 @@
 # RUN: not llvm-ar -M < %t/badlib.mri 2>&1 | FileCheck --check-prefix=PARSE %s
 # RUN: not ls %t/badlib.a
 
-# PARSE: Could not parse library
+# PARSE: error: could not parse library
 
 ## No create command.
 # RUN: echo "ADDLIB %t/f.a"  > %t/nocreate.mri

Modified: llvm/trunk/test/tools/llvm-ar/print.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/print.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/print.test (original)
+++ llvm/trunk/test/tools/llvm-ar/print.test Fri Sep 13 18:18:47 2019
@@ -69,13 +69,13 @@ RUN:   | FileCheck %s --check-prefix=SAM
 RUN: not llvm-ar p 2>&1 \
 RUN:   | FileCheck %s --check-prefix=NO-ARCHIVE
 
-NO-ARCHIVE: error: An archive name must be specified.
+NO-ARCHIVE: error: an archive name must be specified
 
 # Archive does not exist:
 RUN: not llvm-ar p %t/missing.a 2>&1 \
 RUN:   | FileCheck %s --check-prefix=MISSING-ARCHIVE -DARCHIVE=%t/missing.a
 
-MISSING-ARCHIVE: error: error loading '[[ARCHIVE]]': {{[nN]}}o such file or directory.
+MISSING-ARCHIVE: error: error loading '[[ARCHIVE]]': {{[nN]}}o such file or directory
 
 # Member does not exist:
 RUN: not llvm-ar p %t/archive.a %t-missing.txt 2>&1 \

Modified: llvm/trunk/test/tools/llvm-ar/quick-append.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/quick-append.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/quick-append.test (original)
+++ llvm/trunk/test/tools/llvm-ar/quick-append.test Fri Sep 13 18:18:47 2019
@@ -54,13 +54,13 @@
 # RUN: not llvm-ar qc 2>&1 \
 # RUN:   | FileCheck %s --check-prefix=NO-ARCHIVE
 
-# NO-ARCHIVE: error: An archive name must be specified.
+# NO-ARCHIVE: error: an archive name must be specified
 
 ## Member does not exist:
 # RUN: not llvm-ar qc %t/missing.a %t/missing.txt 2>&1 \
 # RUN:   | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt
 
-# MISSING-FILE: error: [[FILE]]: {{[nN]}}o such file or directory.
+# MISSING-FILE: error: [[FILE]]: {{[nN]}}o such file or directory
 
 --- !ELF
 FileHeader:

Modified: llvm/trunk/test/tools/llvm-ar/read-only-archive.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/read-only-archive.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/read-only-archive.test (original)
+++ llvm/trunk/test/tools/llvm-ar/read-only-archive.test Fri Sep 13 18:18:47 2019
@@ -13,7 +13,7 @@
 # RUN: not llvm-ar r %t/archive.a %t/3.txt \
 # RUN:   FileCheck %s --check-prefix=ERROR -DFILE=%t/archive.a
 
-# ERROR: error: [[FILE]]: no such file or directory.
+# ERROR: error: [[FILE]]: no such file or directory
 
 # RUN: not llvm-ar q %t/archive.a %t/3.txt \
 # RUN:   FileCheck %s --check-prefix=ERROR -DFILE=%t/archive.a
@@ -21,7 +21,7 @@
 # RUN: not llvm-ar m %t/archive.a t/1.txt \
 # RUN:   FileCheck %s --check-prefix=ERROR-2 -DFILE=%t/archive.a
 
-# ERROR-2: error: [[FILE]]: permission denied.
+# ERROR-2: error: [[FILE]]: permission denied
 
 # RUN: llvm-ar t %t/archive.a \
 # RUN:   | FileCheck %s --check-prefix=ARCHIVE --match-full-lines --implicit-check-not {{.}}

Modified: llvm/trunk/test/tools/llvm-ar/replace.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-ar/replace.test?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-ar/replace.test (original)
+++ llvm/trunk/test/tools/llvm-ar/replace.test Fri Sep 13 18:18:47 2019
@@ -84,14 +84,14 @@
 # RUN: not llvm-ar r 2>&1 \
 # RUN:   | FileCheck %s --check-prefix=NO-ARCHIVE
 
-# NO-ARCHIVE: error: An archive name must be specified.
+# NO-ARCHIVE: error: an archive name must be specified
 
 ## Member does not exist:
 # RUN: llvm-ar rc %t/missing.a %t/1.o %t/2.o %t/3.o
 # RUN: not llvm-ar r %t/missing.a %t/missing.txt 2>&1 \
 # RUN:   | FileCheck %s --check-prefix=MISSING-FILE -DFILE=%t/missing.txt
 
-# MISSING-FILE: error: [[FILE]]: {{[Nn]}}o such file or directory.
+# MISSING-FILE: error: [[FILE]]: {{[Nn]}}o such file or directory
 
 --- !ELF
 FileHeader:

Modified: llvm/trunk/tools/llvm-ar/llvm-ar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-ar/llvm-ar.cpp?rev=371912&r1=371911&r2=371912&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Fri Sep 13 18:18:47 2019
@@ -118,7 +118,7 @@ void printHelpMessage() {
 
 // Show the error message and exit.
 LLVM_ATTRIBUTE_NORETURN static void fail(Twine Error) {
-  WithColor::error(errs(), ToolName) << Error << ".\n";
+  WithColor::error(errs(), ToolName) << Error << "\n";
   printHelpMessage();
   exit(1);
 }
@@ -209,7 +209,7 @@ static BumpPtrAllocator Alloc;
 // associated with a, b, and i modifiers
 static void getRelPos() {
   if (PositionalArgs.empty())
-    fail("Expected [relpos] for a, b, or i modifier");
+    fail("expected [relpos] for 'a', 'b', or 'i' modifier");
   RelPos = PositionalArgs[0];
   PositionalArgs.erase(PositionalArgs.begin());
 }
@@ -218,19 +218,19 @@ static void getRelPos() {
 // associated with the N modifier
 static void getCountParam() {
   if (PositionalArgs.empty())
-    fail("Expected [count] for N modifier");
+    fail("expected [count] for 'N' modifier");
   auto CountParamArg = StringRef(PositionalArgs[0]);
   if (CountParamArg.getAsInteger(10, CountParam))
-    fail("Value for [count] must be numeric, got: " + CountParamArg);
+    fail("value for [count] must be numeric, got: " + CountParamArg);
   if (CountParam < 1)
-    fail("Value for [count] must be positive, got: " + CountParamArg);
+    fail("value for [count] must be positive, got: " + CountParamArg);
   PositionalArgs.erase(PositionalArgs.begin());
 }
 
 // Get the archive file name from the command line
 static void getArchive() {
   if (PositionalArgs.empty())
-    fail("An archive name must be specified");
+    fail("an archive name must be specified");
   ArchiveName = PositionalArgs[0];
   PositionalArgs.erase(PositionalArgs.begin());
 }
@@ -246,12 +246,12 @@ std::vector<std::unique_ptr<object::Arch
 
 static object::Archive &readLibrary(const Twine &Library) {
   auto BufOrErr = MemoryBuffer::getFile(Library, -1, false);
-  failIfError(BufOrErr.getError(), "Could not open library " + Library);
+  failIfError(BufOrErr.getError(), "could not open library " + Library);
   ArchiveBuffers.push_back(std::move(*BufOrErr));
   auto LibOrErr =
       object::Archive::create(ArchiveBuffers.back()->getMemBufferRef());
   failIfError(errorToErrorCode(LibOrErr.takeError()),
-              "Could not parse library");
+              "could not parse library");
   Archives.push_back(std::move(*LibOrErr));
   return *Archives.back();
 }
@@ -264,7 +264,7 @@ static void runMRIScript();
 static ArchiveOperation parseCommandLine() {
   if (MRI) {
     if (!PositionalArgs.empty() || !Options.empty())
-      fail("Cannot mix -M and other options");
+      fail("cannot mix -M and other options");
     runMRIScript();
   }
 
@@ -383,31 +383,31 @@ static ArchiveOperation parseCommandLine
     NumOperations = 1;
     Operation = CreateSymTab;
     if (!Members.empty())
-      fail("The s operation takes only an archive as argument");
+      fail("the 's' operation takes only an archive as argument");
   }
 
   // Perform various checks on the operation/modifier specification
   // to make sure we are dealing with a legal request.
   if (NumOperations == 0)
-    fail("You must specify at least one of the operations");
+    fail("you must specify at least one of the operations");
   if (NumOperations > 1)
-    fail("Only one operation may be specified");
+    fail("only one operation may be specified");
   if (NumPositional > 1)
-    fail("You may only specify one of a, b, and i modifiers");
+    fail("you may only specify one of 'a', 'b', and 'i' modifiers");
   if (AddAfter || AddBefore)
     if (Operation != Move && Operation != ReplaceOrInsert)
-      fail("The 'a', 'b' and 'i' modifiers can only be specified with "
+      fail("the 'a', 'b' and 'i' modifiers can only be specified with "
            "the 'm' or 'r' operations");
   if (CountParam)
     if (Operation != Extract && Operation != Delete)
-      fail("The 'N' modifier can only be specified with the 'x' or 'd' "
+      fail("the 'N' modifier can only be specified with the 'x' or 'd' "
            "operations");
   if (OriginalDates && Operation != Extract)
-    fail("The 'o' modifier is only applicable to the 'x' operation");
+    fail("the 'o' modifier is only applicable to the 'x' operation");
   if (OnlyUpdate && Operation != ReplaceOrInsert)
-    fail("The 'u' modifier is only applicable to the 'r' operation");
+    fail("the 'u' modifier is only applicable to the 'r' operation");
   if (AddLibrary && Operation != QuickAppend)
-    fail("The 'L' modifier is only applicable to the 'q' operation");
+    fail("the 'L' modifier is only applicable to the 'q' operation");
 
   // Return the parsed operation to the caller
   return Operation;
@@ -589,7 +589,7 @@ static void addChildMember(std::vector<N
                            const object::Archive::Child &M,
                            bool FlattenArchive = false) {
   if (Thin && !M.getParent()->isThin())
-    fail("Cannot convert a regular archive to a thin one");
+    fail("cannot convert a regular archive to a thin one");
   Expected<NewArchiveMember> NMOrErr =
       NewArchiveMember::getOldMember(M, Deterministic);
   failIfError(NMOrErr.takeError());
@@ -783,7 +783,7 @@ computeNewArchiveMembers(ArchiveOperatio
     return Ret;
 
   if (!RelPos.empty() && InsertPos == -1)
-    fail("Insertion point not found");
+    fail("insertion point not found");
 
   if (RelPos.empty())
     InsertPos = Ret.size();
@@ -859,12 +859,12 @@ static void performWriteOperation(Archiv
     break;
   case BSD:
     if (Thin)
-      fail("Only the gnu format has a thin mode");
+      fail("only the gnu format has a thin mode");
     Kind = object::Archive::K_BSD;
     break;
   case DARWIN:
     if (Thin)
-      fail("Only the gnu format has a thin mode");
+      fail("only the gnu format has a thin mode");
     Kind = object::Archive::K_DARWIN;
     break;
   case Unknown:
@@ -922,14 +922,13 @@ static int performOperation(ArchiveOpera
       MemoryBuffer::getFile(ArchiveName, -1, false);
   std::error_code EC = Buf.getError();
   if (EC && EC != errc::no_such_file_or_directory)
-    fail("error opening '" + ArchiveName + "': " + EC.message() + "!");
+    fail("error opening '" + ArchiveName + "': " + EC.message());
 
   if (!EC) {
     Error Err = Error::success();
     object::Archive Archive(Buf.get()->getMemBufferRef(), Err);
     EC = errorToErrorCode(std::move(Err));
-    failIfError(EC,
-                "error loading '" + ArchiveName + "': " + EC.message() + "!");
+    failIfError(EC, "error loading '" + ArchiveName + "': " + EC.message());
     if (Archive.isThin())
       CompareFullPath = true;
     performOperation(Operation, &Archive, std::move(Buf.get()), NewMembers);
@@ -1003,9 +1002,9 @@ static void runMRIScript() {
     case MRICommand::Create:
       Create = true;
       if (!ArchiveName.empty())
-        fail("Editing multiple archives not supported");
+        fail("editing multiple archives not supported");
       if (Saved)
-        fail("File already saved");
+        fail("file already saved");
       ArchiveName = Rest;
       break;
     case MRICommand::Delete: {
@@ -1020,7 +1019,7 @@ static void runMRIScript() {
     case MRICommand::End:
       break;
     case MRICommand::Invalid:
-      fail("Unknown command: " + CommandStr);
+      fail("unknown command: " + CommandStr);
     }
   }
 
@@ -1108,7 +1107,7 @@ static int ranlib_main(int argc, char **
       return 0;
     } else {
       if (ArchiveSpecified)
-        fail("Exactly one archive should be specified");
+        fail("exactly one archive should be specified");
       ArchiveSpecified = true;
       ArchiveName = argv[i];
     }
@@ -1136,5 +1135,5 @@ int main(int argc, char **argv) {
 
   if (Stem.contains_lower("ar"))
     return ar_main(argc, argv);
-  fail("Not ranlib, ar, lib or dlltool!");
+  fail("not ranlib, ar, lib or dlltool");
 }




More information about the llvm-commits mailing list