Add show and merge tools for sample PGO profiles.

Summary:
This patch extends the 'show' and 'merge' commands in llvm-profdata to handle
sample PGO formats. Using the 'merge' command it is now possible to convert
one sample PGO format to another.

The only format that is currently not working is 'gcc'. I still need to
implement support for it in lib/ProfileData.

The changes in the sample profile support classes are needed for the
merge operation.

Reviewers: bogner

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6065

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Diego Novillo
2014-11-01 00:56:55 +00:00
parent e542d91ee5
commit 9657de5f22
9 changed files with 323 additions and 123 deletions

View File

@ -36,6 +36,8 @@ class SampleProfErrorCategoryType : public std::error_category {
return "Truncated profile data";
case sampleprof_error::malformed:
return "Malformed profile data";
case sampleprof_error::unrecognized_format:
return "Unrecognized profile encoding format";
}
llvm_unreachable("A value of sampleprof_error has no message.");
}