From d3b7b12618411b20ae85b16f79b9b76b12beb256 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Tue, 27 Sep 2011 19:36:55 +0000 Subject: Object: Add archive support. llvm-svn: 140626 --- llvm/lib/Object/Binary.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Object/Binary.cpp') 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(Source->getBufferSize())); error_code ec; switch (type) { + case sys::Archive_FileType: { + OwningPtr 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: -- cgit v1.2.3