[llvm] r209500 - llvm-ar: Output the file we errored on.

Filipe Cabecinhas me at filcab.net
Thu May 22 22:52:12 PDT 2014


Author: filcab
Date: Fri May 23 00:52:12 2014
New Revision: 209500

URL: http://llvm.org/viewvc/llvm-project?rev=209500&view=rev
Log:
llvm-ar: Output the file we errored on.

Added:
    llvm/trunk/test/Object/ar-error.test
Modified:
    llvm/trunk/tools/llvm-ar/llvm-ar.cpp

Added: llvm/trunk/test/Object/ar-error.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/ar-error.test?rev=209500&view=auto
==============================================================================
--- llvm/trunk/test/Object/ar-error.test (added)
+++ llvm/trunk/test/Object/ar-error.test Fri May 23 00:52:12 2014
@@ -0,0 +1,5 @@
+Test if we get a proper error with a filename that doesn't exist
+
+RUN: not llvm-ar r %t.out.a sparkle.o %t 2>&1 | FileCheck %s
+
+CHECK: llvm-ar{{(.exe|.EXE)?}}: sparkle.o: No such file or directory

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=209500&r1=209499&r2=209500&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-ar/llvm-ar.cpp (original)
+++ llvm/trunk/tools/llvm-ar/llvm-ar.cpp Fri May 23 00:52:12 2014
@@ -516,7 +516,7 @@ computeInsertAction(ArchiveOperation Ope
     // We could try to optimize this to a fstat, but it is not a common
     // operation.
     sys::fs::file_status Status;
-    failIfError(sys::fs::status(*MI, Status));
+    failIfError(sys::fs::status(*MI, Status), *MI);
     if (Status.getLastModificationTime() < I->getLastModified()) {
       if (PosName.empty())
         return IA_AddOldMember;





More information about the llvm-commits mailing list