From ce03155a1bd02fc078f710b5497be4e382bbe5d9 Mon Sep 17 00:00:00 2001 From: Mircea Trofin Date: Tue, 9 Jul 2024 14:35:49 -0700 Subject: [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 --- llvm/lib/ProfileData/SampleProf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/ProfileData/SampleProf.cpp') 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); -- cgit v1.2.3