summaryrefslogtreecommitdiff
path: root/tools/llvm-lto
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-03-15 20:17:55 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-03-15 20:17:55 +0000
commit3e2997601dcb521ec57c41a2c4f50186533830d5 (patch)
tree112083824df95fd1ed64f2a708cbd86ab82ae504 /tools/llvm-lto
parentd135b1ffead9b64cd9e61158ea9f689f06477971 (diff)
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 <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-lto')
-rw-r--r--tools/llvm-lto/llvm-lto.cpp1
1 files changed, 1 insertions, 0 deletions
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<std::unique_ptr<ModuleSummaryIndex>> IndexOrErr =
llvm::getModuleSummaryIndexForFile(Filename, diagnosticHandler);
+ error(IndexOrErr, "error: " + CurrentActivity);
std::unique_ptr<ModuleSummaryIndex> Index = std::move(IndexOrErr.get());
CurrentActivity = "";
// Skip files without a module summary.