diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-11 04:28:40 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-11 04:28:40 +0000 |
commit | 41af43092ccc8030bb49cea324d85eecd5ae68a8 (patch) | |
tree | f30038673dd27f2d4785068fffd510abe4fb23d7 /llvm/lib/Object/Archive.cpp | |
parent | e8e98dcb74cd6d297c31c023bfacdf7f28cdaabc (diff) | |
download | bcm5719-llvm-41af43092ccc8030bb49cea324d85eecd5ae68a8.tar.gz bcm5719-llvm-41af43092ccc8030bb49cea324d85eecd5ae68a8.zip |
Make the Error class constructor protected
This is forcing to use Error::success(), which is in a wide majority
of cases a lot more readable.
Differential Revision: https://reviews.llvm.org/D26481
llvm-svn: 286561
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 4684c186fb4..f2021f796d1 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -458,7 +458,7 @@ Expected<Archive::Child> Archive::Child::getNext() const { return malformedError(Msg + NameOrErr.get()); } - Error Err; + Error Err = Error::success(); Child Ret(Parent, NextLoc, &Err); if (Err) return std::move(Err); @@ -508,7 +508,7 @@ Archive::Child::getAsBinary(LLVMContext *Context) const { } Expected<std::unique_ptr<Archive>> Archive::create(MemoryBufferRef Source) { - Error Err; + Error Err = Error::success(); std::unique_ptr<Archive> Ret(new Archive(Source, Err)); if (Err) return std::move(Err); @@ -830,7 +830,7 @@ Expected<Archive::Child> Archive::Symbol::getMember() const { } const char *Loc = Parent->getData().begin() + Offset; - Error Err; + Error Err = Error::success(); Child C(Parent, Loc, &Err); if (Err) return std::move(Err); |