Move ProfileSummary to IR.
This splits ProfileSummary into two classes: a ProfileSummary class that has methods to convert from/to metadata and a ProfileSummaryBuilder class that computes the profiles summary which is in ProfileData. Differential Revision: http://reviews.llvm.org/D20314 llvm-svn: 270136
This commit is contained in:
@@ -793,10 +793,10 @@ SampleProfileReader::create(std::unique_ptr<MemoryBuffer> &B, LLVMContext &C) {
|
||||
// For text and GCC file formats, we compute the summary after reading the
|
||||
// profile. Binary format has the profile summary in its header.
|
||||
void SampleProfileReader::computeSummary() {
|
||||
Summary.reset(new SampleProfileSummary(ProfileSummary::DefaultCutoffs));
|
||||
SampleProfileSummaryBuilder Builder(ProfileSummaryBuilder::DefaultCutoffs);
|
||||
for (const auto &I : Profiles) {
|
||||
const FunctionSamples &Profile = I.second;
|
||||
Summary->addRecord(Profile);
|
||||
Builder.addRecord(Profile);
|
||||
}
|
||||
Summary->computeDetailedSummary();
|
||||
Summary.reset(Builder.getSummary());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user