aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Object/Archive.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Object/Archive.h')
-rw-r--r--include/llvm/Object/Archive.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/llvm/Object/Archive.h b/include/llvm/Object/Archive.h
index 652b659..af6c995 100644
--- a/include/llvm/Object/Archive.h
+++ b/include/llvm/Object/Archive.h
@@ -72,7 +72,7 @@ public:
Child getNext() const;
- error_code getName(StringRef &Result) const;
+ ErrorOr<StringRef> getName() const;
StringRef getRawName() const { return getHeader()->getName(); }
sys::TimeValue getLastModified() const {
return getHeader()->getLastModified();
@@ -89,11 +89,11 @@ public:
return StringRef(Data.data() + StartOfFile, getSize());
}
- error_code getMemoryBuffer(std::unique_ptr<MemoryBuffer> &Result,
- bool FullPath = false) const;
+ ErrorOr<std::unique_ptr<MemoryBuffer>>
+ getMemoryBuffer(bool FullPath = false) const;
- error_code getAsBinary(std::unique_ptr<Binary> &Result,
- LLVMContext *Context = nullptr) const;
+ ErrorOr<std::unique_ptr<Binary>>
+ getAsBinary(LLVMContext *Context = nullptr) const;
};
class child_iterator {
@@ -137,8 +137,8 @@ public:
: Parent(p)
, SymbolIndex(symi)
, StringIndex(stri) {}
- error_code getName(StringRef &Result) const;
- error_code getMember(child_iterator &Result) const;
+ StringRef getName() const;
+ ErrorOr<child_iterator> getMember() const;
Symbol getNext() const;
};
@@ -164,8 +164,8 @@ public:
}
};
- Archive(MemoryBuffer *source, error_code &ec);
- static ErrorOr<Archive *> create(MemoryBuffer *Source);
+ Archive(std::unique_ptr<MemoryBuffer> Source, std::error_code &EC);
+ static ErrorOr<Archive *> create(std::unique_ptr<MemoryBuffer> Source);
enum Kind {
K_GNU,