From f49d8fcbd594007ac6f25a1f1f90919221011f97 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Fri, 28 Jun 2013 09:44:05 +0000 Subject: [PATCH] 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 --- lib/Object/Binary.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) {