Re-apply r249644: Handle inline stacks in gcov-encoded sample profiles.
authorDiego Novillo <dnovillo@google.com>
Thu, 8 Oct 2015 19:40:37 +0000 (19:40 +0000)
committerDiego Novillo <dnovillo@google.com>
Thu, 8 Oct 2015 19:40:37 +0000 (19:40 +0000)
commit3bc8dc3685a10faff5e419e4c8a4f8392030fd59
treeae99cc7033504e78dc37583018d004192b294efd
parent08c4d76572a1289f779cca9fc5e26d6d588657d0
Re-apply r249644: Handle inline stacks in gcov-encoded sample profiles.

This fixes memory allocation problems by making the merge operation keep
the profile readers around until the merged profile has been emitted.
This is needed to prevent the inlined function names to disappear from
the function profiles. Since all the names are kept as references, once
the reader disappears, the names are also deallocated.

Additionally, XFAIL on big-endian architectures. The test case uses a
gcov file generated on a little-endian system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249724 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ProfileData/SampleProf.h
include/llvm/ProfileData/SampleProfReader.h
include/llvm/ProfileData/SampleProfWriter.h
lib/ProfileData/SampleProfReader.cpp
lib/ProfileData/SampleProfWriter.cpp
test/tools/llvm-profdata/Inputs/gcc-sample-profile.gcov [new file with mode: 0644]
test/tools/llvm-profdata/gcc-gcov-sample-profile.test [new file with mode: 0644]
tools/llvm-profdata/llvm-profdata.cpp