summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitc60a321c6b26c99aadc27b81c11806fa88f7fcfa (patch)
tree6532c358ea218eb59cb99ff161d5520a132223c0 /llvm/tools/lli
parentdadf7b293d732ebe984c4a16cdddf4cb31364fff (diff)
downloadbcm5719-llvm-c60a321c6b26c99aadc27b81c11806fa88f7fcfa.tar.gz
bcm5719-llvm-c60a321c6b26c99aadc27b81c11806fa88f7fcfa.zip
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. llvm-svn: 274160
Diffstat (limited to 'llvm/tools/lli')
-rw-r--r--llvm/tools/lli/lli.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index 14e03fb5a93..92de5da4721 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud