aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-profdata/llvm-profdata.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2024-07-09 14:35:49 -0700
committerGitHub <noreply@github.com>2024-07-09 14:35:49 -0700
commitce03155a1bd02fc078f710b5497be4e382bbe5d9 (patch)
treeb19c81a46fd1cbb69ae26b8060c0793e1c67dba8 /llvm/tools/llvm-profdata/llvm-profdata.cpp
parentf363e30f15ef274f94dba53a13d73998066a0148 (diff)
downloadllvm-ce03155a1bd02fc078f710b5497be4e382bbe5d9.zip
llvm-ce03155a1bd02fc078f710b5497be4e382bbe5d9.tar.gz
llvm-ce03155a1bd02fc078f710b5497be4e382bbe5d9.tar.bz2
[NFC] Coding style fixes: SampleProf (#98208)
Also some control flow simplifications. Notably, this doesn't address `sampleprof_error`. I *think* the style there tries to match `std::error_category`. Also left `hash_value` as-is, because it matches what we do in Hashing.h
Diffstat (limited to 'llvm/tools/llvm-profdata/llvm-profdata.cpp')
-rw-r--r--llvm/tools/llvm-profdata/llvm-profdata.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 2ce0668..39cc87c 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -1421,7 +1421,8 @@ remapSamples(const sampleprof::FunctionSamples &Samples,
for (const auto &Callsite : CallsiteSamples.second) {
sampleprof::FunctionSamples Remapped =
remapSamples(Callsite.second, Remapper, Error);
- MergeResult(Error, Target[Remapped.getFunction()].merge(Remapped));
+ mergeSampleProfErrors(Error,
+ Target[Remapped.getFunction()].merge(Remapped));
}
}
return Result;
@@ -1542,7 +1543,8 @@ static void mergeSampleProfile(const WeightedFileVector &Inputs,
: FunctionSamples();
FunctionSamples &Samples = Remapper ? Remapped : I->second;
SampleContext FContext = Samples.getContext();
- MergeResult(Result, ProfileMap[FContext].merge(Samples, Input.Weight));
+ mergeSampleProfErrors(Result,
+ ProfileMap[FContext].merge(Samples, Input.Weight));
if (Result != sampleprof_error::success) {
std::error_code EC = make_error_code(Result);
handleMergeWriterError(errorCodeToError(EC), Input.Filename,