@@ -55,7 +55,7 @@ class ProfOStream {
5555 ProfOStream (raw_string_ostream &STR)
5656 : IsFDOStream(false ), OS(STR), LE(STR, llvm::endianness::little) {}
5757
58- uint64_t tell () { return OS.tell (); }
58+ [[nodiscard]] uint64_t tell () const { return OS.tell (); }
5959 void write (uint64_t V) { LE.write <uint64_t >(V); }
6060 void write32 (uint32_t V) { LE.write <uint32_t >(V); }
6161 void writeByte (uint8_t V) { LE.write <uint8_t >(V); }
@@ -894,7 +894,7 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
894894 BinaryIds.erase (std::unique (BinaryIds.begin (), BinaryIds.end ()),
895895 BinaryIds.end ());
896896
897- for (auto BI : BinaryIds) {
897+ for (const auto & BI : BinaryIds) {
898898 // Increment by binary id length data type size.
899899 BinaryIdsSectionSize += sizeof (uint64_t );
900900 // Increment by binary id data length, aligned to 8 bytes.
@@ -903,7 +903,7 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
903903 // Write binary ids section size.
904904 OS.write (BinaryIdsSectionSize);
905905
906- for (auto BI : BinaryIds) {
906+ for (const auto & BI : BinaryIds) {
907907 uint64_t BILen = BI.size ();
908908 // Write binary id length.
909909 OS.write (BILen);
0 commit comments