diff options
Diffstat (limited to 'llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r-- | llvm/lib/ProfileData/InstrProf.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 0ccc16252c2..a06a4370d61 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -641,4 +641,19 @@ void ProfileSummary::computeDetailedSummary() { } } +ProfileSummary::ProfileSummary(const IndexedInstrProf::Summary &S) + : TotalCount(S.get(IndexedInstrProf::Summary::TotalBlockCount)), + MaxBlockCount(S.get(IndexedInstrProf::Summary::MaxBlockCount)), + MaxInternalBlockCount( + S.get(IndexedInstrProf::Summary::MaxInternalBlockCount)), + MaxFunctionCount(S.get(IndexedInstrProf::Summary::MaxFunctionCount)), + NumBlocks(S.get(IndexedInstrProf::Summary::TotalNumBlocks)), + NumFunctions(S.get(IndexedInstrProf::Summary::TotalNumFunctions)) { + for (unsigned I = 0; I < S.NumCutoffEntries; I++) { + const IndexedInstrProf::Summary::Entry &Ent = S.getEntry(I); + DetailedSummary.emplace_back((uint32_t)Ent.Cutoff, Ent.MinBlockCount, + Ent.NumBlocks); + } +} + } // end namespace llvm |