diff options
| author | Dehao Chen <dehao@google.com> | 2017-05-11 23:43:44 +0000 |
|---|---|---|
| committer | Dehao Chen <dehao@google.com> | 2017-05-11 23:43:44 +0000 |
| commit | 8d1c983f451f9256062bd92ba8358723c7254216 (patch) | |
| tree | 47abd16d7e1b76bef829fd7f10c25c69ba7c1260 /llvm/include | |
| parent | 0f01fb39e3fe3d8e99df1dd185e75ad584b777b3 (diff) | |
| download | bcm5719-llvm-8d1c983f451f9256062bd92ba8358723c7254216.tar.gz bcm5719-llvm-8d1c983f451f9256062bd92ba8358723c7254216.zip | |
Change sample profile writer to make it deterministic.
Summary: This patch changes the function profile output order to be deterministic. In order to make it easier to understand, hottest functions (with most total samples) is ordered first.
Reviewers: dnovillo, davidxl
Reviewed By: dnovillo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33111
llvm-svn: 302851
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/ProfileData/SampleProfWriter.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/llvm/include/llvm/ProfileData/SampleProfWriter.h b/llvm/include/llvm/ProfileData/SampleProfWriter.h index 9d69af32dd4..86af1038d74 100644 --- a/llvm/include/llvm/ProfileData/SampleProfWriter.h +++ b/llvm/include/llvm/ProfileData/SampleProfWriter.h @@ -43,16 +43,7 @@ public: /// Write all the sample profiles in the given map of samples. /// /// \returns status code of the file update operation. - std::error_code write(const StringMap<FunctionSamples> &ProfileMap) { - if (std::error_code EC = writeHeader(ProfileMap)) - return EC; - for (const auto &I : ProfileMap) { - const FunctionSamples &Profile = I.second; - if (std::error_code EC = write(Profile)) - return EC; - } - return sampleprof_error::success; - } + std::error_code write(const StringMap<FunctionSamples> &ProfileMap); raw_ostream &getOutputStream() { return *OutputStream; } |

