[llvm-profdata] Add option to cap profile output size
authorWilliam Huang <williamjhuang@google.com>
Wed, 18 Jan 2023 01:10:47 +0000 (01:10 +0000)
committerWilliam Huang <williamjhuang@google.com>
Wed, 8 Feb 2023 02:17:12 +0000 (02:17 +0000)
commit48f163b889a8f373474c7d198c43e27779f38692
tree399ecf16ee5dcdd311a8380309228ed9e8d2a3b5
parent1fbccfd69324f08f067ca5534abc67d32cad75ed
[llvm-profdata] Add option to cap profile output size

D139603 (add option to llvm-profdata to reduce output profile size) contains test cases that are not cross-platform. Moving those tests to unit test and making sure the feature is callable from llvm library

Reviewed By: snehasish

Differential Revision: https://reviews.llvm.org/D141446
llvm/include/llvm/ProfileData/SampleProf.h
llvm/include/llvm/ProfileData/SampleProfWriter.h
llvm/lib/ProfileData/SampleProfWriter.cpp
llvm/tools/llvm-profdata/llvm-profdata.cpp
llvm/unittests/tools/CMakeLists.txt
llvm/unittests/tools/llvm-profdata/CMakeLists.txt [new file with mode: 0644]
llvm/unittests/tools/llvm-profdata/OutputSizeLimitTest.cpp [new file with mode: 0644]