diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-06-18 15:03:28 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-06-18 15:03:28 +0000 |
commit | e6388e622e32f7c840d015b0710dcdde56af639e (patch) | |
tree | 59397d191d7fd2cbe3d7d0746fac7cb373842dc9 /llvm/lib/Object/Binary.cpp | |
parent | 63d84f8149156eae20cf21e06c0212c14cf6ed44 (diff) | |
download | bcm5719-llvm-e6388e622e32f7c840d015b0710dcdde56af639e.tar.gz bcm5719-llvm-e6388e622e32f7c840d015b0710dcdde56af639e.zip |
Basic support for parsing Mach-O universal binaries in LLVMObject library
llvm-svn: 184191
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r-- | llvm/lib/Object/Binary.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp index a1497708c1e..177c86c5465 100644 --- a/llvm/lib/Object/Binary.cpp +++ b/llvm/lib/Object/Binary.cpp @@ -20,6 +20,7 @@ // Include headers for createBinary. #include "llvm/Object/Archive.h" #include "llvm/Object/COFF.h" +#include "llvm/Object/MachOUniversal.h" #include "llvm/Object/ObjectFile.h" using namespace llvm; @@ -82,6 +83,12 @@ error_code object::createBinary(MemoryBuffer *Source, Result.swap(ret); return object_error::success; } + case sys::fs::file_magic::macho_universal_binary: { + OwningPtr<Binary> ret(new MachOUniversalBinary(scopedSource.take(), ec)); + if (ec) return ec; + Result.swap(ret); + return object_error::success; + } case sys::fs::file_magic::coff_object: case sys::fs::file_magic::pecoff_executable: { OwningPtr<Binary> ret( |