summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Binary.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-06-28 09:44:05 +0000
committerAlexey Samsonov <samsonov@google.com>2013-06-28 09:44:05 +0000
commit64188f9f2b2a8c28cb3006705ae08c61afbd792d (patch)
treecf6b1f4aef117571faf0b700b2c8dcb6dd135707 /llvm/lib/Object/Binary.cpp
parent593f833e9bd209b1074159393cc6a746f7428ffb (diff)
downloadbcm5719-llvm-64188f9f2b2a8c28cb3006705ae08c61afbd792d.tar.gz
bcm5719-llvm-64188f9f2b2a8c28cb3006705ae08c61afbd792d.zip
Make a switch in createBinary fully-covered. Add forgotten macho_dsym_companion case.
llvm-svn: 185139
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r--llvm/lib/Object/Binary.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp
index 177c86c5465..fd9d3b4bd75 100644
--- a/llvm/lib/Object/Binary.cpp
+++ b/llvm/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<Binary> 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<Binary> &Result) {
OpenPOWER on IntegriCloud