diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-03-15 20:17:55 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-03-15 20:17:55 +0000 |
commit | ef156c6701170a3e52cbc710b036b6fb133829bd (patch) | |
tree | 424542c00a6228eaa7829c38667847b3e327c762 | |
parent | 1396809b17f330e7bd1ff528bcd529796ddb207b (diff) | |
download | bcm5719-llvm-ef156c6701170a3e52cbc710b036b6fb133829bd.tar.gz bcm5719-llvm-ef156c6701170a3e52cbc710b036b6fb133829bd.zip |
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>
llvm-svn: 263577
-rw-r--r-- | llvm/tools/llvm-lto/llvm-lto.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/tools/llvm-lto/llvm-lto.cpp b/llvm/tools/llvm-lto/llvm-lto.cpp index 8aadc406f99..d6f3d8a39f3 100644 --- a/llvm/tools/llvm-lto/llvm-lto.cpp +++ b/llvm/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. |