diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index f566bf7457d..fda55e4b575 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -544,15 +544,14 @@ int main(int argc, char **argv, char * const *envp) { Err.print(argv[0], errs()); return 1; } - std::error_code EC; - std::unique_ptr Ar = - llvm::make_unique(std::move(ArBuf.get()), EC); - assert(Ar); - if (EC) { - Err.print(argv[0], errs()); + + ErrorOr> ArOrErr = + object::Archive::create(std::move(ArBuf.get())); + if (std::error_code EC = ArOrErr.getError()) { + errs() << EC.message(); return 1; } - EE->addArchive(std::move(Ar)); + EE->addArchive(std::move(ArOrErr.get())); } // If the target is Cygwin/MingW and we are generating remote code, we