@@ -608,38 +608,34 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
608
608
}
609
609
610
610
uint64_t VTableNamesSectionStart = 0 ;
611
- VTableNamesSectionStart = OS.tell ();
612
611
613
- std::string CompressedVTableNames ;
612
+ VTableNamesSectionStart = OS. tell () ;
614
613
615
- std::vector<std::string> VTableNameStrs;
616
- for (const auto &VTableName : VTableNames.keys ()) {
614
+ std::vector<std::string> VTableNameStrs;
615
+ for (const auto &VTableName : VTableNames.keys ())
617
616
VTableNameStrs.push_back (VTableName.str ());
618
- }
619
617
620
- if (!VTableNameStrs.empty ()) {
621
- if (Error E = collectGlobalObjectNameStrings (
622
- VTableNameStrs, compression::zlib::isAvailable (),
623
- CompressedVTableNames))
624
- return E;
625
- }
618
+ std::string CompressedVTableNames;
619
+ if (!VTableNameStrs.empty ())
620
+ if (Error E = collectGlobalObjectNameStrings (
621
+ VTableNameStrs, compression::zlib::isAvailable (), CompressedVTableNames))
622
+ return E;
626
623
627
- uint64_t CompressedStringLen = CompressedVTableNames.length ();
624
+ const uint64_t CompressedStringLen = CompressedVTableNames.length ();
628
625
629
- // Record the length of compressed string.
630
- OS.write (CompressedStringLen);
626
+ // Record the length of compressed string.
627
+ OS.write (CompressedStringLen);
631
628
632
- // Write the chars in compressed strings.
633
- for (auto &c : CompressedVTableNames)
634
- OS.writeByte (static_cast <uint8_t >(c));
629
+ // Write the chars in compressed strings.
630
+ for (auto &c : CompressedVTableNames)
631
+ OS.writeByte (static_cast <uint8_t >(c));
635
632
636
- // Pad up to a multiple of 8.
637
- // InstrProfReader could read bytes according to 'CompressedStringLen'.
638
- uint64_t PaddedLength = alignTo (CompressedStringLen, 8 );
633
+ // Pad up to a multiple of 8.
634
+ // InstrProfReader could read bytes according to 'CompressedStringLen'.
635
+ const uint64_t PaddedLength = alignTo (CompressedStringLen, 8 );
639
636
640
- for (uint64_t K = CompressedStringLen; K < PaddedLength; K++) {
641
- OS.writeByte (0 );
642
- }
637
+ for (uint64_t K = CompressedStringLen; K < PaddedLength; K++)
638
+ OS.writeByte (0 );
643
639
644
640
uint64_t TemporalProfTracesSectionStart = 0 ;
645
641
if (static_cast <bool >(ProfileKind & InstrProfKind::TemporalProfile)) {
0 commit comments