summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/Binary.cpp
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-06-18 15:03:28 +0000
committerAlexey Samsonov <samsonov@google.com>2013-06-18 15:03:28 +0000
commite6388e622e32f7c840d015b0710dcdde56af639e (patch)
tree59397d191d7fd2cbe3d7d0746fac7cb373842dc9 /llvm/lib/Object/Binary.cpp
parent63d84f8149156eae20cf21e06c0212c14cf6ed44 (diff)
downloadbcm5719-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.cpp7
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(
OpenPOWER on IntegriCloud