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

@ -16,6 +16,7 @@
#define LLVM_PROFILEDATA_COVERAGEMAPPING_H_
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/raw_ostream.h"
#include <system_error>
@ -186,13 +187,9 @@ public:
void dump(const Counter &C, llvm::raw_ostream &OS) const;
void dump(const Counter &C) const { dump(C, llvm::outs()); }
/// \brief Return the number of times that a region of code
/// associated with this counter was executed.
int64_t evaluate(const Counter &C, std::error_code *Error) const;
int64_t evaluate(const Counter &C, std::error_code &Error) const {
Error.clear();
return evaluate(C, &Error);
}
/// \brief Return the number of times that a region of code associated with
/// this counter was executed.
ErrorOr<int64_t> evaluate(const Counter &C) const;
};
} // end namespace coverage