[NFC][SampleFDO] Move some common stuff from SampleProfileReaderExtBinary/WriterExtBinary
authorWei Mi <wmi@google.com>
Thu, 15 Oct 2020 22:17:28 +0000 (15:17 -0700)
committerWei Mi <wmi@google.com>
Thu, 22 Oct 2020 22:56:55 +0000 (15:56 -0700)
commit93953d411a0fc240e10237fea34aaff43e8f0ff5
tree38a2e385bf90254e1fa37d9e60aa66197b5e344a
parentc2730e6b36a1806dcc4fa3e90674b974d5b8931e
[NFC][SampleFDO] Move some common stuff from SampleProfileReaderExtBinary/WriterExtBinary
to their parent classes.

SampleProfileReaderExtBinary/SampleProfileWriterExtBinary specify the typical
section layout currently used by SampleFDO. Currently a lot of section
reader/writer stay in the two classes. However, as we expect to have more
types of SampleFDO profiles, we hope those new types of profiles can share
the common sections while configuring their own sections easily with minimal
change. That is why I move some common stuff from
SampleProfileReaderExtBinary/SampleProfileWriterExtBinary to
SampleProfileReaderExtBinaryBase/SampleProfileWriterExtBinaryBase so new
profiles class inheriting from the base class can reuse them.

Differential Revision: https://reviews.llvm.org/D89524
llvm/include/llvm/ProfileData/SampleProfReader.h
llvm/include/llvm/ProfileData/SampleProfWriter.h
llvm/lib/ProfileData/SampleProfReader.cpp
llvm/lib/ProfileData/SampleProfWriter.cpp