Index: include/llvm/ProfileData/InstrProfReader.h =================================================================== --- include/llvm/ProfileData/InstrProfReader.h +++ include/llvm/ProfileData/InstrProfReader.h @@ -397,6 +397,8 @@ std::unique_ptr Index; /// Profile summary data. std::unique_ptr Summary; + // Index to the current record in the record array. + unsigned RecordIndex; // Read the profile summary. Return a pointer pointing to one byte past the // end of the summary data if it exists or the input \c Cur. @@ -405,7 +407,7 @@ public: IndexedInstrProfReader(std::unique_ptr DataBuffer) - : DataBuffer(std::move(DataBuffer)) {} + : DataBuffer(std::move(DataBuffer)), RecordIndex(0) {} IndexedInstrProfReader(const IndexedInstrProfReader &) = delete; IndexedInstrProfReader &operator=(const IndexedInstrProfReader &) = delete; Index: lib/ProfileData/InstrProfReader.cpp =================================================================== --- lib/ProfileData/InstrProfReader.cpp +++ lib/ProfileData/InstrProfReader.cpp @@ -733,8 +733,6 @@ } Error IndexedInstrProfReader::readNextRecord(NamedInstrProfRecord &Record) { - static unsigned RecordIndex = 0; - ArrayRef Data; Error E = Index->getRecords(Data);