[llvm] r271021 - [ProfData] Remove global constructor from ProfileSummaryBuilder.
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Fri May 27 10:38:23 PDT 2016
Author: d0k
Date: Fri May 27 12:38:16 2016
New Revision: 271021
URL: http://llvm.org/viewvc/llvm-project?rev=271021&view=rev
Log:
[ProfData] Remove global constructor from ProfileSummaryBuilder.
No functionality change intended.
Modified:
llvm/trunk/include/llvm/ProfileData/ProfileCommon.h
llvm/trunk/lib/ProfileData/ProfileSummaryBuilder.cpp
Modified: llvm/trunk/include/llvm/ProfileData/ProfileCommon.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/ProfileCommon.h?rev=271021&r1=271020&r2=271021&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/ProfileCommon.h (original)
+++ llvm/trunk/include/llvm/ProfileData/ProfileCommon.h Fri May 27 12:38:16 2016
@@ -63,7 +63,7 @@ protected:
public:
/// \brief A vector of useful cutoff values for detailed summary.
- static const std::vector<uint32_t> DefaultCutoffs;
+ static const ArrayRef<uint32_t> DefaultCutoffs;
};
class InstrProfSummaryBuilder final : public ProfileSummaryBuilder {
@@ -73,7 +73,7 @@ class InstrProfSummaryBuilder final : pu
public:
InstrProfSummaryBuilder(std::vector<uint32_t> Cutoffs)
- : ProfileSummaryBuilder(Cutoffs), MaxInternalBlockCount(0) {}
+ : ProfileSummaryBuilder(std::move(Cutoffs)), MaxInternalBlockCount(0) {}
void addRecord(const InstrProfRecord &);
std::unique_ptr<ProfileSummary> getSummary();
};
@@ -83,7 +83,7 @@ class SampleProfileSummaryBuilder final
public:
void addRecord(const sampleprof::FunctionSamples &FS);
SampleProfileSummaryBuilder(std::vector<uint32_t> Cutoffs)
- : ProfileSummaryBuilder(Cutoffs) {}
+ : ProfileSummaryBuilder(std::move(Cutoffs)) {}
std::unique_ptr<ProfileSummary> getSummary();
};
Modified: llvm/trunk/lib/ProfileData/ProfileSummaryBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/ProfileSummaryBuilder.cpp?rev=271021&r1=271020&r2=271021&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/ProfileSummaryBuilder.cpp (original)
+++ llvm/trunk/lib/ProfileData/ProfileSummaryBuilder.cpp Fri May 27 12:38:16 2016
@@ -25,11 +25,13 @@ using namespace llvm;
// A set of cutoff values. Each value, when divided by ProfileSummary::Scale
// (which is 1000000) is a desired percentile of total counts.
-const std::vector<uint32_t> ProfileSummaryBuilder::DefaultCutoffs(
- {10000, /* 1% */
- 100000, /* 10% */
- 200000, 300000, 400000, 500000, 600000, 500000, 600000, 700000, 800000,
- 900000, 950000, 990000, 999000, 999900, 999990, 999999});
+static const uint32_t DefaultCutoffsData[] = {
+ 10000, /* 1% */
+ 100000, /* 10% */
+ 200000, 300000, 400000, 500000, 600000, 500000, 600000, 700000,
+ 800000, 900000, 950000, 990000, 999000, 999900, 999990, 999999};
+const ArrayRef<uint32_t> ProfileSummaryBuilder::DefaultCutoffs =
+ DefaultCutoffsData;
void InstrProfSummaryBuilder::addRecord(const InstrProfRecord &R) {
// The first counter is not necessarily an entry count for IR
More information about the llvm-commits
mailing list