aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/InstrProfWriter.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-05-13 21:50:56 +0000
committerVedant Kumar <vsk@apple.com>2016-05-13 21:50:56 +0000
commitdf41bd89a56d03aa88cdfc2f8b1255f8ed3fbeca (patch)
treeb0dcdec3d4dc0fbfc605c79c26bf3818ae8ad93e /llvm/lib/ProfileData/InstrProfWriter.cpp
parent5a625be808a10b2120e3c988022e07db3a36799f (diff)
downloadllvm-df41bd89a56d03aa88cdfc2f8b1255f8ed3fbeca.zip
llvm-df41bd89a56d03aa88cdfc2f8b1255f8ed3fbeca.tar.gz
llvm-df41bd89a56d03aa88cdfc2f8b1255f8ed3fbeca.tar.bz2
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
Diffstat (limited to 'llvm/lib/ProfileData/InstrProfWriter.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProfWriter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index d6caca2a..9b01dac 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -156,8 +156,7 @@ void InstrProfWriter::setOutputSparse(bool Sparse) {
this->Sparse = Sparse;
}
-std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I,
- uint64_t Weight) {
+Error InstrProfWriter::addRecord(InstrProfRecord &&I, uint64_t Weight) {
auto &ProfileDataMap = FunctionData[I.Name];
bool NewFunc;
@@ -180,7 +179,7 @@ std::error_code InstrProfWriter::addRecord(InstrProfRecord &&I,
Dest.sortValueData();
- return Dest.getError();
+ return Dest.takeError();
}
bool InstrProfWriter::shouldEncodeData(const ProfilingData &PD) {