summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-16 16:08:36 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-16 16:08:36 +0000
commit0659928fec02d5a953e528739cc036f7a68deb63 (patch)
treea1bfb3747233ad5bc9a52fc7321565997855a4ea /include/llvm
parentd492c19894f41ca20d451e3e7ae5a7340728882b (diff)
downloadllvm-0659928fec02d5a953e528739cc036f7a68deb63.tar.gz
llvm-0659928fec02d5a953e528739cc036f7a68deb63.tar.bz2
llvm-0659928fec02d5a953e528739cc036f7a68deb63.tar.xz
Convert the Archive API to use ErrorOr.
Now that we have c++11, even things like ErrorOr<std::unique_ptr<...>> are easy to use. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Object/Archive.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/Object/Archive.h b/include/llvm/Object/Archive.h
index 600ab23a78..4fe44a7769 100644
--- a/include/llvm/Object/Archive.h
+++ b/include/llvm/Object/Archive.h
@@ -72,7 +72,7 @@ public:
Child getNext() const;
- std::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());
}
- std::error_code getMemoryBuffer(std::unique_ptr<MemoryBuffer> &Result,
- bool FullPath = false) const;
+ ErrorOr<std::unique_ptr<MemoryBuffer>>
+ getMemoryBuffer(bool FullPath = false) const;
- std::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) {}
- std::error_code getName(StringRef &Result) const;
- std::error_code getMember(child_iterator &Result) const;
+ StringRef getName() const;
+ ErrorOr<child_iterator> getMember() const;
Symbol getNext() const;
};