summaryrefslogtreecommitdiff
path: root/tools/lli
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2016-06-29 20:35:44 +0000
committerKevin Enderby <enderby@apple.com>2016-06-29 20:35:44 +0000
commit0b21d88fd31b4bfb6fdb7e2f1ed5f93639d5bd1c (patch)
tree08092bf45f2d4c264837718186cc82d766c88959 /tools/lli
parentb76b4707be8f8a807efe8538534eee3ea0ba279c (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/lli')
-rw-r--r--tools/lli/lli.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 14e03fb5a93..92de5da4721 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -511,10 +511,14 @@ int main(int argc, char **argv, char * const *envp) {
}
std::unique_ptr<MemoryBuffer> &ArBuf = ArBufOrErr.get();
- ErrorOr<std::unique_ptr<object::Archive>> ArOrErr =
+ Expected<std::unique_ptr<object::Archive>> ArOrErr =
object::Archive::create(ArBuf->getMemBufferRef());
- if (std::error_code EC = ArOrErr.getError()) {
- errs() << EC.message();
+ if (!ArOrErr) {
+ std::string Buf;
+ raw_string_ostream OS(Buf);
+ logAllUnhandledErrors(ArOrErr.takeError(), OS, "");
+ OS.flush();
+ errs() << Buf;
return 1;
}
std::unique_ptr<object::Archive> &Ar = ArOrErr.get();