aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/SampleProfReader.cpp
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2016-05-19 21:07:12 +0000
committerEaswaran Raman <eraman@google.com>2016-05-19 21:07:12 +0000
commite5a17e3f1d1d620d0793f36f54654951a4440f99 (patch)
tree29453f82d5ec2e7a668a9bbceb7d8bc300ce0e73 /llvm/lib/ProfileData/SampleProfReader.cpp
parentb1d37199ccfad5654d587cb9a81bcfde613315b4 (diff)
downloadllvm-e5a17e3f1d1d620d0793f36f54654951a4440f99.zip
llvm-e5a17e3f1d1d620d0793f36f54654951a4440f99.tar.gz
llvm-e5a17e3f1d1d620d0793f36f54654951a4440f99.tar.bz2
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
Diffstat (limited to 'llvm/lib/ProfileData/SampleProfReader.cpp')
-rw-r--r--llvm/lib/ProfileData/SampleProfReader.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index 63f8286..14023bb 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -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());
}