llvm-cov: Use ErrorOr rather than an error_code* (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Bogner
2014-09-08 21:04:00 +00:00
parent 4cd53531fd
commit 78834e522f
3 changed files with 25 additions and 35 deletions

View File

@ -411,10 +411,10 @@ bool CodeCoverageTool::load() {
}
outs() << "\n";
}
std::error_code Error;
Function.MappingRegions.push_back(
MappingRegion(R, Ctx.evaluate(R.Count, Error)));
if (Error && !RegionError) {
ErrorOr<int64_t> ExecutionCount = Ctx.evaluate(R.Count);
if (ExecutionCount) {
Function.MappingRegions.push_back(MappingRegion(R, *ExecutionCount));
} else if (!RegionError) {
colored_ostream(errs(), raw_ostream::RED)
<< "error: Regions and counters don't match in a function '"
<< Function.Name << "' (re-run the instrumented binary).";