summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cov/TestingSupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-cov/TestingSupport.cpp')
-rw-r--r--llvm/tools/llvm-cov/TestingSupport.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cov/TestingSupport.cpp b/llvm/tools/llvm-cov/TestingSupport.cpp
index 6959897482c..f6c91f85c84 100644
--- a/llvm/tools/llvm-cov/TestingSupport.cpp
+++ b/llvm/tools/llvm-cov/TestingSupport.cpp
@@ -36,8 +36,12 @@ int convertForTestingMain(int argc, const char *argv[]) {
cl::ParseCommandLineOptions(argc, argv, "LLVM code coverage tool\n");
auto ObjErr = llvm::object::ObjectFile::createObjectFile(InputSourceFile);
- if (auto Err = ObjErr.getError()) {
- errs() << "error: " << Err.message() << "\n";
+ if (!ObjErr) {
+ std::string Buf;
+ raw_string_ostream OS(Buf);
+ logAllUnhandledErrors(ObjErr.takeError(), OS, "");
+ OS.flush();
+ errs() << "error: " << Buf;
return 1;
}
ObjectFile *OF = ObjErr.get().getBinary();
OpenPOWER on IntegriCloud