[llvm-readobj] Remove dead code. Add an assertion instead.
authorDavide Italiano <davide@freebsd.org>
Wed, 13 Jan 2016 04:11:36 +0000 (04:11 +0000)
committerDavide Italiano <davide@freebsd.org>
Wed, 13 Jan 2016 04:11:36 +0000 (04:11 +0000)
When we arrive at the end of the function, the validation of
the object has been done already. In theory, so, we should never
arrive here with something broken as the object isn't mutated.
Practice sometimes proves theory to be wrong, so leave an assertion
instead, as suggested by David Blaikie, to catch bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257570 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objdump/MachODump.cpp

index 87b2b439d55cc6136530e8fa3e714e1e386f297a..258c0b520a3d4f6ecfcb9f864d9bf9668679fcf7 100644 (file)
@@ -1651,8 +1651,9 @@ void llvm::ParseInputMachO(StringRef Filename) {
     } else
       errs() << "llvm-objdump: '" << Filename << "': "
              << "Object is not a Mach-O file type.\n";
-  } else
-    report_error(Filename, object_error::invalid_file_type);
+    return;
+  }
+  llvm_unreachable("Input object can't be invalid at this point");
 }
 
 typedef std::pair<uint64_t, const char *> BindInfoEntry;