diff options
Diffstat (limited to 'llvm/lib/ProfileData/SampleProf.cpp')
-rw-r--r-- | llvm/lib/ProfileData/SampleProf.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/ProfileData/SampleProf.cpp b/llvm/lib/ProfileData/SampleProf.cpp index 3d75d230fb6..c376a8bbd98 100644 --- a/llvm/lib/ProfileData/SampleProf.cpp +++ b/llvm/lib/ProfileData/SampleProf.cpp @@ -108,15 +108,18 @@ void FunctionSamples::print(raw_ostream &OS, unsigned Indent) const { OS << TotalSamples << ", " << TotalHeadSamples << ", " << BodySamples.size() << " sampled lines\n"; - for (const auto &SI : BodySamples) { + SampleSorter<LineLocation, SampleRecord> SortedBodySamples(BodySamples); + for (const auto &SI : SortedBodySamples.get()) { OS.indent(Indent); - OS << SI.first << ": " << SI.second; + OS << SI->first << ": " << SI->second; } - for (const auto &CS : CallsiteSamples) { + SampleSorter<CallsiteLocation, FunctionSamples> SortedCallsiteSamples( + CallsiteSamples); + for (const auto &CS : SortedCallsiteSamples.get()) { OS.indent(Indent); - OS << CS.first << ": "; - CS.second.print(OS, Indent + 2); + OS << CS->first << ": "; + CS->second.print(OS, Indent + 2); } } |