From ed7a4ba53481007a5d80e5588b5a9191950349f0 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Wed, 13 Jan 2016 04:11:36 +0000 Subject: [PATCH] [llvm-readobj] Remove dead code. Add an assertion instead. 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/llvm-objdump/MachODump.cpp b/tools/llvm-objdump/MachODump.cpp index 87b2b439d55..258c0b520a3 100644 --- a/tools/llvm-objdump/MachODump.cpp +++ b/tools/llvm-objdump/MachODump.cpp @@ -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 BindInfoEntry; -- 2.34.1