1818#include " llvm/ADT/StringRef.h"
1919#include " llvm/IR/ProfileSummary.h"
2020#include " llvm/ProfileData/InstrProf.h"
21- #include " llvm/ProfileData/InstrProfCorrelator.h"
2221#include " llvm/Support/Endian.h"
2322#include " llvm/Support/Error.h"
2423#include " llvm/Support/LineIterator.h"
@@ -97,9 +96,6 @@ class InstrProfReader {
9796
9897 virtual bool instrEntryBBEnabled () const = 0;
9998
100- // / Return true if we must provide debug info to create PGO profiles.
101- virtual bool useDebugInfoCorrelate () const { return false ; }
102-
10399 // / Return the PGO symtab. There are three different readers:
104100 // / Raw, Text, and Indexed profile readers. The first two types
105101 // / of readers are used only by llvm-profdata tool, while the indexed
@@ -154,12 +150,10 @@ class InstrProfReader {
154150
155151 // / Factory method to create an appropriately typed reader for the given
156152 // / instrprof file.
157- static Expected<std::unique_ptr<InstrProfReader>>
158- create (const Twine &Path, const InstrProfCorrelator *Correlator = nullptr );
153+ static Expected<std::unique_ptr<InstrProfReader>> create (const Twine &Path);
159154
160155 static Expected<std::unique_ptr<InstrProfReader>>
161- create (std::unique_ptr<MemoryBuffer> Buffer,
162- const InstrProfCorrelator *Correlator = nullptr );
156+ create (std::unique_ptr<MemoryBuffer> Buffer);
163157};
164158
165159// / Reader for the simple text based instrprof format.
@@ -221,9 +215,6 @@ class RawInstrProfReader : public InstrProfReader {
221215private:
222216 // / The profile data file contents.
223217 std::unique_ptr<MemoryBuffer> DataBuffer;
224- // / If available, this hold the ProfileData array used to correlate raw
225- // / instrumentation data to their functions.
226- const InstrProfCorrelatorImpl<IntPtrT> *Correlator;
227218 bool ShouldSwapBytes;
228219 // The value of the version field of the raw profile data header. The lower 56
229220 // bits specifies the format version and the most significant 8 bits specify
@@ -235,7 +226,7 @@ class RawInstrProfReader : public InstrProfReader {
235226 const RawInstrProf::ProfileData<IntPtrT> *DataEnd;
236227 const uint64_t *CountersStart;
237228 const char *NamesStart;
238- const char *NamesEnd ;
229+ uint64_t NamesSize ;
239230 // After value profile is all read, this pointer points to
240231 // the header of next profile data (if exists)
241232 const uint8_t *ValueDataStart;
@@ -246,11 +237,8 @@ class RawInstrProfReader : public InstrProfReader {
246237 const uint8_t *BinaryIdsStart;
247238
248239public:
249- RawInstrProfReader (std::unique_ptr<MemoryBuffer> DataBuffer,
250- const InstrProfCorrelator *Correlator)
251- : DataBuffer(std::move(DataBuffer)),
252- Correlator (dyn_cast_or_null<const InstrProfCorrelatorImpl<IntPtrT>>(
253- Correlator)) {}
240+ RawInstrProfReader (std::unique_ptr<MemoryBuffer> DataBuffer)
241+ : DataBuffer(std::move(DataBuffer)) {}
254242 RawInstrProfReader (const RawInstrProfReader &) = delete ;
255243 RawInstrProfReader &operator =(const RawInstrProfReader &) = delete ;
256244
@@ -271,10 +259,6 @@ class RawInstrProfReader : public InstrProfReader {
271259 return (Version & VARIANT_MASK_INSTR_ENTRY) != 0 ;
272260 }
273261
274- bool useDebugInfoCorrelate () const override {
275- return (Version & VARIANT_MASK_DBG_CORRELATE) != 0 ;
276- }
277-
278262 InstrProfSymtab &getSymtab () override {
279263 assert (Symtab.get ());
280264 return *Symtab.get ();
0 commit comments