diff options
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
-rw-r--r-- | llvm/tools/lli/lli.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 43aedd1526a..f566bf7457d 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -545,12 +545,14 @@ int main(int argc, char **argv, char * const *envp) { return 1; } std::error_code EC; - object::Archive *Ar = new object::Archive(std::move(ArBuf.get()), EC); - if (EC || !Ar) { + std::unique_ptr<object::Archive> Ar = + llvm::make_unique<object::Archive>(std::move(ArBuf.get()), EC); + assert(Ar); + if (EC) { Err.print(argv[0], errs()); return 1; } - EE->addArchive(Ar); + EE->addArchive(std::move(Ar)); } // If the target is Cygwin/MingW and we are generating remote code, we |