diff options
Diffstat (limited to 'lld/COFF')
-rw-r--r-- | lld/COFF/DriverUtils.cpp | 6 | ||||
-rw-r--r-- | lld/COFF/InputFiles.cpp | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lld/COFF/DriverUtils.cpp b/lld/COFF/DriverUtils.cpp index ff8729df198..13ec6a80f15 100644 --- a/lld/COFF/DriverUtils.cpp +++ b/lld/COFF/DriverUtils.cpp @@ -706,9 +706,9 @@ static std::string replace(StringRef S, StringRef From, StringRef To) { // import files to that file. void writeImportLibrary() { std::unique_ptr<MemoryBuffer> Buf = createEmptyImportLibrary(); - std::error_code EC; - object::Archive Archive(Buf->getMemBufferRef(), EC); - error(EC, "Error reading an empty import file"); + llvm::Error Err; + object::Archive Archive(Buf->getMemBufferRef(), Err); + error(errorToErrorCode(std::move(Err)), "Error reading an empty import file"); std::vector<NewArchiveIterator> Members = readMembers(Archive); std::string DLLName = llvm::sys::path::filename(Config->OutputFile); diff --git a/lld/COFF/InputFiles.cpp b/lld/COFF/InputFiles.cpp index 4a40382a60e..7fd9b84ae5e 100644 --- a/lld/COFF/InputFiles.cpp +++ b/lld/COFF/InputFiles.cpp @@ -64,7 +64,8 @@ std::string InputFile::getShortName() { void ArchiveFile::parse() { // Parse a MemoryBufferRef as an archive file. auto ArchiveOrErr = Archive::create(MB); - error(ArchiveOrErr, "Failed to parse static library"); + error(errorToErrorCode(ArchiveOrErr.takeError()), + "Failed to parse static library"); File = std::move(*ArchiveOrErr); // Allocate a buffer for Lazy objects. |