[llvm-readobj] Fix another "time of check to time of use bug".

It seems there's more copy-paste between tools than needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247954 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano 2015-09-17 22:29:58 +00:00
parent 5fab6109a3
commit 919b448c2e
2 changed files with 2 additions and 5 deletions

View File

@ -0,0 +1,2 @@
RUN: not llvm-readobj %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory

View 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);