Retry "[ProfileData] (llvm) Use Error in InstrProf and Coverage, NFC"
Transition InstrProf and Coverage over to the stricter Error/Expected interface. Changes since the initial commit: - Fix error message printing in llvm-profdata. - Check errors in loadTestingFormat() + annotateAllFunctions(). - Defer error handling in InstrProfIterator to InstrProfReader. Differential Revision: http://reviews.llvm.org/D19901 llvm-svn: 269491
This commit is contained in:
@@ -210,10 +210,9 @@ std::unique_ptr<CoverageMapping> CodeCoverageTool::load() {
|
||||
errs() << "warning: profile data may be out of date - object is newer\n";
|
||||
auto CoverageOrErr = CoverageMapping::load(ObjectFilename, PGOFilename,
|
||||
CoverageArch);
|
||||
if (std::error_code EC = CoverageOrErr.getError()) {
|
||||
if (Error E = CoverageOrErr.takeError()) {
|
||||
colored_ostream(errs(), raw_ostream::RED)
|
||||
<< "error: Failed to load coverage: " << EC.message();
|
||||
errs() << "\n";
|
||||
<< "error: Failed to load coverage: " << toString(std::move(E)) << "\n";
|
||||
return nullptr;
|
||||
}
|
||||
auto Coverage = std::move(CoverageOrErr.get());
|
||||
|
||||
Reference in New Issue
Block a user