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
This commit is contained in:
Alexey Samsonov 2013-06-28 09:44:05 +00:00
parent 8175bc3d3b
commit f49d8fcbd5

View File

@ -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_dynamically_linked_shared_lib:
case sys::fs::file_magic::macho_dynamic_linker: case sys::fs::file_magic::macho_dynamic_linker:
case sys::fs::file_magic::macho_bundle: 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<Binary> ret( OwningPtr<Binary> ret(
ObjectFile::createMachOObjectFile(scopedSource.take())); ObjectFile::createMachOObjectFile(scopedSource.take()));
if (!ret) if (!ret)
@ -98,9 +99,13 @@ error_code object::createBinary(MemoryBuffer *Source,
Result.swap(ret); Result.swap(ret);
return object_error::success; 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; return object_error::invalid_file_type;
}
} }
llvm_unreachable("Unexpected Binary File Type");
} }
error_code object::createBinary(StringRef Path, OwningPtr<Binary> &Result) { error_code object::createBinary(StringRef Path, OwningPtr<Binary> &Result) {