[llvm] r247744 - [llvm-cxxdump] Remove duplicate code check.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 16:35:32 PDT 2015


Author: davide
Date: Tue Sep 15 18:35:32 2015
New Revision: 247744

URL: http://llvm.org/viewvc/llvm-project?rev=247744&view=rev
Log:
[llvm-cxxdump] Remove duplicate code check.

We already fail with 'No such file or directory' when we try to open
the file -- if that doesn't exist. Also add a test to verify this behavior.

Modified:
    llvm/trunk/test/tools/llvm-cxxdump/trivial.test
    llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp

Modified: llvm/trunk/test/tools/llvm-cxxdump/trivial.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxdump/trivial.test?rev=247744&r1=247743&r2=247744&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cxxdump/trivial.test (original)
+++ llvm/trunk/test/tools/llvm-cxxdump/trivial.test Tue Sep 15 18:35:32 2015
@@ -56,3 +56,6 @@ ELF-I386:      _ZTS1A: 1A
 ELF-I386-NEXT: _ZTV1A[0]: 0
 ELF-I386-NEXT: _ZTV1A[4]: _ZTI1A
 ELF-I386-NEXT: _ZTV1A[8]: _ZN1A1fEv
+
+RUN: not llvm-cxxdump %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
+ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory

Modified: llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp?rev=247744&r1=247743&r2=247744&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp (original)
+++ llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp Tue Sep 15 18:35:32 2015
@@ -499,12 +499,6 @@ static void dumpArchive(const Archive *A
 }
 
 static void dumpInput(StringRef File) {
-  // If file isn't stdin, check that it exists.
-  if (File != "-" && !sys::fs::exists(File)) {
-    reportError(File, cxxdump_error::file_not_found);
-    return;
-  }
-
   // Attempt to open the binary.
   ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(File);
   if (std::error_code EC = BinaryOrErr.getError()) {




More information about the llvm-commits mailing list