[llvm-readobj] Fix another "time of check to time of use bug".
[oota-llvm.git] / tools / llvm-readobj / llvm-readobj.cpp
index a8e4ca4893f7ae27330ff303e9b455d8db6b0c57..7e7c4eeaff722aa8a53fbe9e56ab9cb1e6f926ef 100644 (file)
@@ -394,11 +394,6 @@ static void dumpMachOUniversalBinary(const MachOUniversalBinary *UBinary) {
 
 /// @brief Opens \a File and dumps it.
 static void dumpInput(StringRef File) {
-  // If file isn't stdin, check that it exists.
-  if (File != "-" && !sys::fs::exists(File)) {
-    reportError(File, readobj_error::file_not_found);
-    return;
-  }
 
   // Attempt to open the binary.
   ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(File);