summaryrefslogtreecommitdiff
path: root/lib/Object/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Object/Archive.cpp')
-rw-r--r--lib/Object/Archive.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp
index 3c9eda74b5..286e9eebab 100644
--- a/lib/Object/Archive.cpp
+++ b/lib/Object/Archive.cpp
@@ -194,6 +194,14 @@ error_code Archive::Child::getAsBinary(OwningPtr<Binary> &Result) const {
return object_error::success;
}
+ErrorOr<Archive*> Archive::create(MemoryBuffer *Source) {
+ error_code EC;
+ OwningPtr<Archive> Ret(new Archive(Source, EC));
+ if (EC)
+ return EC;
+ return Ret.take();
+}
+
Archive::Archive(MemoryBuffer *source, error_code &ec)
: Binary(Binary::ID_Archive, source), SymbolTable(child_end()) {
// Check for sufficient magic.