From 3e2997601dcb521ec57c41a2c4f50186533830d5 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Tue, 15 Mar 2016 20:17:55 +0000 Subject: Add missing error handling in llvm-lto Annoyingly, ErrorOr allows to *not check* the error when things go well. It will crash badly when there is an error though. It should runtime assert when it is used without being checked! From: Mehdi Amini git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263577 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-lto/llvm-lto.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/llvm-lto') diff --git a/tools/llvm-lto/llvm-lto.cpp b/tools/llvm-lto/llvm-lto.cpp index 8aadc406f99..d6f3d8a39f3 100644 --- a/tools/llvm-lto/llvm-lto.cpp +++ b/tools/llvm-lto/llvm-lto.cpp @@ -258,6 +258,7 @@ static void createCombinedModuleSummaryIndex() { CurrentActivity = "loading file '" + Filename + "'"; ErrorOr> IndexOrErr = llvm::getModuleSummaryIndexForFile(Filename, diagnosticHandler); + error(IndexOrErr, "error: " + CurrentActivity); std::unique_ptr Index = std::move(IndexOrErr.get()); CurrentActivity = ""; // Skip files without a module summary. -- cgit v1.2.3