diff options
author | Fangrui Song <maskray@google.com> | 2019-04-09 05:41:24 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-04-09 05:41:24 +0000 |
commit | 3f2096833a7bce99aea7b06468621a3a5be6475e (patch) | |
tree | 75c6b25f1462badd9e9ffb66f4d3e66640f874df /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 206b9927f8362fe0a65151f76ec67caffe39d3ad (diff) | |
download | llvm-3f2096833a7bce99aea7b06468621a3a5be6475e.zip llvm-3f2096833a7bce99aea7b06468621a3a5be6475e.tar.gz llvm-3f2096833a7bce99aea7b06468621a3a5be6475e.tar.bz2 |
[llvm-objdump] Migrate some functions from std::error_code to Error
llvm-svn: 357965
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index aa9b13d..b2068f8 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -355,14 +355,6 @@ LLVM_ATTRIBUTE_NORETURN void llvm::report_error(StringRef File, exit(1); } -LLVM_ATTRIBUTE_NORETURN void llvm::report_error(StringRef File, - std::error_code EC) { - assert(EC); - WithColor::error(errs(), ToolName) - << "'" << File << "': " << EC.message() << ".\n"; - exit(1); -} - LLVM_ATTRIBUTE_NORETURN void llvm::report_error(Error E, StringRef File) { assert(E); std::string Buf; @@ -2013,7 +2005,8 @@ static void dumpArchive(const Archive *A) { else if (COFFImportFile *I = dyn_cast<COFFImportFile>(&*ChildOrErr.get())) dumpObject(I, A, &C); else - report_error(A->getFileName(), object_error::invalid_file_type); + report_error(errorCodeToError(object_error::invalid_file_type), + A->getFileName()); } if (Err) report_error(std::move(Err), A->getFileName()); @@ -2040,7 +2033,7 @@ static void dumpInput(StringRef file) { else if (MachOUniversalBinary *UB = dyn_cast<MachOUniversalBinary>(&Binary)) parseInputMachO(UB); else - report_error(file, object_error::invalid_file_type); + report_error(errorCodeToError(object_error::invalid_file_type), file); } int main(int argc, char **argv) { |