From: Davide Italiano Date: Wed, 13 Jan 2016 04:11:36 +0000 (+0000) Subject: [llvm-readobj] Remove dead code. Add an assertion instead. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=ed7a4ba53481007a5d80e5588b5a9191950349f0 [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 --- 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;