From a16c004a031d46672eb84632dbedd5d104f3bbff Mon Sep 17 00:00:00 2001 From: Piotr Padlewski Date: Fri, 30 Sep 2016 21:05:52 +0000 Subject: [PATCH] NFC fix class members initialization llvm-svn: 282951 --- llvm/include/llvm/ProfileData/ProfileCommon.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/ProfileData/ProfileCommon.h b/llvm/include/llvm/ProfileData/ProfileCommon.h index ecb228c..e955755 100644 --- a/llvm/include/llvm/ProfileData/ProfileCommon.h +++ b/llvm/include/llvm/ProfileData/ProfileCommon.h @@ -45,22 +45,21 @@ inline const char *getUnlikelySectionPrefix() { return ".unlikely"; } 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> CountFrequencies; std::vector DetailedSummaryCutoffs; protected: SummaryEntryVector DetailedSummary; ProfileSummaryBuilder(std::vector 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 Cutoffs) - : ProfileSummaryBuilder(std::move(Cutoffs)), MaxInternalBlockCount(0) {} + : ProfileSummaryBuilder(std::move(Cutoffs)) {} void addRecord(const InstrProfRecord &); std::unique_ptr getSummary(); }; @@ -88,7 +87,7 @@ public: std::unique_ptr 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) -- 2.7.4