diff options
author | Kevin Enderby <enderby@apple.com> | 2016-06-29 20:35:44 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2016-06-29 20:35:44 +0000 |
commit | 0b21d88fd31b4bfb6fdb7e2f1ed5f93639d5bd1c (patch) | |
tree | 08092bf45f2d4c264837718186cc82d766c88959 /tools/llvm-ar | |
parent | b76b4707be8f8a807efe8538534eee3ea0ba279c (diff) |
Change Archive::create() from ErrorOr<...> to Expected<...> and update
its clients.
This commit will break the next lld builds. I’ll be committing the matching
change for lld next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index c8e241e2bf6..f918a3e5136 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -713,7 +713,9 @@ static int performOperation(ArchiveOperation Operation, fail("error opening '" + ArchiveName + "': " + EC.message() + "!"); if (!EC) { - object::Archive Archive(Buf.get()->getMemBufferRef(), EC); + Error Err; + object::Archive Archive(Buf.get()->getMemBufferRef(), Err); + EC = errorToErrorCode(std::move(Err)); failIfError(EC, "error loading '" + ArchiveName + "': " + EC.message() + "!"); performOperation(Operation, &Archive, std::move(Buf.get()), NewMembers); @@ -768,7 +770,8 @@ static void runMRIScript() { ArchiveBuffers.push_back(std::move(*BufOrErr)); auto LibOrErr = object::Archive::create(ArchiveBuffers.back()->getMemBufferRef()); - failIfError(LibOrErr.getError(), "Could not parse library"); + failIfError(errorToErrorCode(LibOrErr.takeError()), + "Could not parse library"); Archives.push_back(std::move(*LibOrErr)); object::Archive &Lib = *Archives.back(); for (auto &MemberOrErr : Lib.children()) { |