summaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/SampleProf.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/lib/ProfileData/SampleProf.cpp
parentf363e30f15ef274f94dba53a13d73998066a0148 (diff)
[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/lib/ProfileData/SampleProf.cpp')
-rw-r--r--llvm/lib/ProfileData/SampleProf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp
index 59fa71899ed4..294f64636d98 100644
--- a/llvm/lib/ProfileData/SampleProf.cpp
+++ b/llvm/lib/ProfileData/SampleProf.cpp
@@ -121,7 +121,7 @@ sampleprof_error SampleRecord::merge(const SampleRecord &Other,
sampleprof_error Result;
Result = addSamples(Other.getSamples(), Weight);
for (const auto &I : Other.getCallTargets()) {
- MergeResult(Result, addCalledTarget(I.first, I.second, Weight));
+ mergeSampleProfErrors(Result, addCalledTarget(I.first, I.second, Weight));
}
return Result;
}
@@ -364,7 +364,7 @@ void SampleContextTrimmer::trimAndMergeColdContextProfiles(
if (ColdContextFrameLength < MergedContext.size())
MergedContext = MergedContext.take_back(ColdContextFrameLength);
// Need to set MergedProfile's context here otherwise it will be lost.
- FunctionSamples &MergedProfile = MergedProfileMap.Create(MergedContext);
+ FunctionSamples &MergedProfile = MergedProfileMap.create(MergedContext);
MergedProfile.merge(*I.second);
}
ProfileMap.erase(I.first);