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
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.