From: Alexey Samsonov Date: Fri, 28 Jun 2013 09:44:05 +0000 (+0000) Subject: Make a switch in createBinary fully-covered. Add forgotten macho_dsym_companion case. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f49d8fcbd594007ac6f25a1f1f90919221011f97;p=oota-llvm.git Make a switch in createBinary fully-covered. Add forgotten macho_dsym_companion case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185139 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Object/Binary.cpp b/lib/Object/Binary.cpp index 177c86c5465..fd9d3b4bd75 100644 --- a/lib/Object/Binary.cpp +++ b/lib/Object/Binary.cpp @@ -75,7 +75,8 @@ error_code object::createBinary(MemoryBuffer *Source, case sys::fs::file_magic::macho_dynamically_linked_shared_lib: case sys::fs::file_magic::macho_dynamic_linker: case sys::fs::file_magic::macho_bundle: - case sys::fs::file_magic::macho_dynamically_linked_shared_lib_stub: { + case sys::fs::file_magic::macho_dynamically_linked_shared_lib_stub: + case sys::fs::file_magic::macho_dsym_companion: { OwningPtr ret( ObjectFile::createMachOObjectFile(scopedSource.take())); if (!ret) @@ -98,9 +99,13 @@ error_code object::createBinary(MemoryBuffer *Source, Result.swap(ret); return object_error::success; } - default: // Unrecognized object file format. + case sys::fs::file_magic::unknown: + case sys::fs::file_magic::bitcode: { + // Unrecognized object file format. return object_error::invalid_file_type; + } } + llvm_unreachable("Unexpected Binary File Type"); } error_code object::createBinary(StringRef Path, OwningPtr &Result) {