[llvm] r282951 - NFC fix class members initialization
Piotr Padlewski via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 30 14:05:52 PDT 2016
Author: prazek
Date: Fri Sep 30 16:05:52 2016
New Revision: 282951
URL: http://llvm.org/viewvc/llvm-project?rev=282951&view=rev
Log:
NFC fix class members initialization
Modified:
llvm/trunk/include/llvm/ProfileData/ProfileCommon.h
Modified: llvm/trunk/include/llvm/ProfileData/ProfileCommon.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/ProfileCommon.h?rev=282951&r1=282950&r2=282951&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/ProfileCommon.h (original)
+++ llvm/trunk/include/llvm/ProfileData/ProfileCommon.h Fri Sep 30 16:05:52 2016
@@ -45,22 +45,21 @@ inline const char *getUnlikelySectionPre
class ProfileSummaryBuilder {
private:
- // We keep track of the number of times a count (block count or samples)
- // appears in the profile. The map is kept sorted in the descending order of
- // counts.
+ /// We keep track of the number of times a count (block count or samples)
+ /// appears in the profile. The map is kept sorted in the descending order of
+ /// counts.
std::map<uint64_t, uint32_t, std::greater<uint64_t>> CountFrequencies;
std::vector<uint32_t> DetailedSummaryCutoffs;
protected:
SummaryEntryVector DetailedSummary;
ProfileSummaryBuilder(std::vector<uint32_t> Cutoffs)
- : DetailedSummaryCutoffs(std::move(Cutoffs)), TotalCount(0), MaxCount(0),
- MaxFunctionCount(0), NumCounts(0), NumFunctions(0) {}
+ : DetailedSummaryCutoffs(std::move(Cutoffs)) {}
inline void addCount(uint64_t Count);
~ProfileSummaryBuilder() = default;
void computeDetailedSummary();
- uint64_t TotalCount, MaxCount, MaxFunctionCount;
- uint32_t NumCounts, NumFunctions;
+ uint64_t TotalCount = 0, MaxCount = 0, MaxFunctionCount = 0;
+ uint32_t NumCounts = 0, NumFunctions = 0;
public:
/// \brief A vector of useful cutoff values for detailed summary.
@@ -68,13 +67,13 @@ public:
};
class InstrProfSummaryBuilder final : public ProfileSummaryBuilder {
- uint64_t MaxInternalBlockCount;
+ uint64_t MaxInternalBlockCount = 0;
inline void addEntryCount(uint64_t Count);
inline void addInternalCount(uint64_t Count);
public:
InstrProfSummaryBuilder(std::vector<uint32_t> Cutoffs)
- : ProfileSummaryBuilder(std::move(Cutoffs)), MaxInternalBlockCount(0) {}
+ : ProfileSummaryBuilder(std::move(Cutoffs)) {}
void addRecord(const InstrProfRecord &);
std::unique_ptr<ProfileSummary> getSummary();
};
@@ -88,7 +87,7 @@ public:
std::unique_ptr<ProfileSummary> getSummary();
};
-// This is called when a count is seen in the profile.
+/// This is called when a count is seen in the profile.
void ProfileSummaryBuilder::addCount(uint64_t Count) {
TotalCount += Count;
if (Count > MaxCount)
More information about the llvm-commits
mailing list