diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-09-27 19:36:55 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-09-27 19:36:55 +0000 |
commit | d3b7b12618411b20ae85b16f79b9b76b12beb256 (patch) | |
tree | 557b95f1ada1c5bd3b3af68a3705f8bd1437b5a1 /llvm/lib/Object/Binary.cpp | |
parent | 68ba81346e9f3ecb4b30288edbf2a0674974285f (diff) | |
download | bcm5719-llvm-d3b7b12618411b20ae85b16f79b9b76b12beb256.tar.gz bcm5719-llvm-d3b7b12618411b20ae85b16f79b9b76b12beb256.zip |
Object: Add archive support.
llvm-svn: 140626
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r-- | llvm/lib/Object/Binary.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp index 4b31c7557dd..3b00bebaa6e 100644 --- a/llvm/lib/Object/Binary.cpp +++ b/llvm/lib/Object/Binary.cpp @@ -17,8 +17,9 @@ #include "llvm/Support/Path.h" // Include headers for createBinary. -#include "llvm/Object/ObjectFile.h" +#include "llvm/Object/Archive.h" #include "llvm/Object/COFF.h" +#include "llvm/Object/ObjectFile.h" using namespace llvm; using namespace object; @@ -50,6 +51,12 @@ error_code object::createBinary(MemoryBuffer *Source, static_cast<unsigned>(Source->getBufferSize())); error_code ec; switch (type) { + case sys::Archive_FileType: { + OwningPtr<Binary> ret(new Archive(scopedSource.take(), ec)); + if (ec) return ec; + Result.swap(ret); + return object_error::success; + } case sys::ELF_Relocatable_FileType: case sys::ELF_Executable_FileType: case sys::ELF_SharedObject_FileType: |