diff --git a/llvm/test/Object/ar-create.test b/llvm/test/Object/ar-create.test --- a/llvm/test/Object/ar-create.test +++ b/llvm/test/Object/ar-create.test @@ -13,5 +13,5 @@ RUN: llvm-ar r %t.foo.a %t 2>&1 | FileCheck --check-prefix=CREATE %s RUN: rm -f %t.foo.a -CHECK: llvm-ar{{(.exe|.EXE)?}}: error: error loading '{{[^']+}}.foo.a': +CHECK: llvm-ar{{(.exe|.EXE)?}}: error: unable to load '{{[^']+}}.foo.a': CREATE: creating {{.*}}.foo.a diff --git a/llvm/test/tools/llvm-ar/print.test b/llvm/test/tools/llvm-ar/print.test --- a/llvm/test/tools/llvm-ar/print.test +++ b/llvm/test/tools/llvm-ar/print.test @@ -75,7 +75,7 @@ # 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: unable to load '[[ARCHIVE]]': {{[nN]}}o such file or directory ## No Permission # RUN: llvm-ar -rc %t/permission.b %t/1.txt @@ -83,14 +83,14 @@ # RUN: not llvm-ar p %t/permission.b 2>&1 \ # RUN: | FileCheck %s --check-prefix=NO-PERMISSION -DARCHIVE=%t/permission.b -# NO-PERMISSION: error: error opening '[[ARCHIVE]]': Permission denied +# NO-PERMISSION: error: unable to open '[[ARCHIVE]]': Permission denied ## Passing in a directory # RUN: mkdir -p %t/tmpDir # RUN: not llvm-ar p %t/tmpDir 2>&1 \ # RUN: | FileCheck %s --check-prefix=IS-DIR -DARCHIVE=%t/tmpDir -# IS-DIR: error: error opening '[[ARCHIVE]]': Is a directory +# IS-DIR: error: unable to open '[[ARCHIVE]]': Is a directory ## Member does not exist: # RUN: not llvm-ar p %t/archive.a %t-missing.txt 2>&1 \ diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -520,7 +520,7 @@ static bool comparePaths(StringRef Path1, StringRef Path2) { // When on Windows this function calls CompareStringOrdinal -// as Windows file paths are case-insensitive. +// as Windows file paths are case-insensitive. // CompareStringOrdinal compares two Unicode strings for // binary equivalence and allows for case insensitivity. #ifdef _WIN32 @@ -660,7 +660,8 @@ Expected FileNameOrErr(M.getName()); failIfError(FileNameOrErr.takeError()); if (sys::path::is_absolute(*FileNameOrErr)) { - NMOrErr->MemberName = Saver.save(sys::path::convert_to_slash(*FileNameOrErr)); + NMOrErr->MemberName = + Saver.save(sys::path::convert_to_slash(*FileNameOrErr)); } else { FileNameOrErr = M.getFullName(); failIfError(FileNameOrErr.takeError()); @@ -999,7 +1000,7 @@ 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("unable to open '" + ArchiveName + "': " + EC.message()); if (!EC) { Error Err = Error::success(); @@ -1014,7 +1015,7 @@ assert(EC == errc::no_such_file_or_directory); if (!shouldCreateArchive(Operation)) { - failIfError(EC, Twine("error loading '") + ArchiveName + "'"); + failIfError(EC, Twine("unable to load '") + ArchiveName + "'"); } else { if (!Create) { // Produce a warning if we should and we're creating the archive @@ -1028,7 +1029,16 @@ } static void runMRIScript() { - enum class MRICommand { AddLib, AddMod, Create, CreateThin, Delete, Save, End, Invalid }; + enum class MRICommand { + AddLib, + AddMod, + Create, + CreateThin, + Delete, + Save, + End, + Invalid + }; ErrorOr> Buf = MemoryBuffer::getSTDIN(); failIfError(Buf.getError()); @@ -1100,9 +1110,9 @@ fail("unknown command: " + CommandStr); } } - + ParsingMRIScript = false; - + // Nothing to do if not saved. if (Saved) performOperation(ReplaceOrInsert, &NewMembers);