Skip to content

Commit a61c8a4

Browse files
A few changes after 'git merge main':
- undo binary profile change on existing binary files {c-general.profraw, compressed.profraw}. - run clang-format and 'git merge main' - Delete obsolete vtable raw profile llvm/test/Transforms/PGOProfile/Inputs/vtable_prof.profraw
1 parent a7633ad commit a61c8a4

File tree

6 files changed

+19
-23
lines changed

6 files changed

+19
-23
lines changed

llvm/lib/ProfileData/InstrProfWriter.cpp

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -608,38 +608,34 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
608608
}
609609

610610
uint64_t VTableNamesSectionStart = 0;
611-
VTableNamesSectionStart = OS.tell();
612611

613-
std::string CompressedVTableNames;
612+
VTableNamesSectionStart = OS.tell();
614613

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())
617616
VTableNameStrs.push_back(VTableName.str());
618-
}
619617

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;
626623

627-
uint64_t CompressedStringLen = CompressedVTableNames.length();
624+
const uint64_t CompressedStringLen = CompressedVTableNames.length();
628625

629-
// Record the length of compressed string.
630-
OS.write(CompressedStringLen);
626+
// Record the length of compressed string.
627+
OS.write(CompressedStringLen);
631628

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));
635632

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);
639636

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);
643639

644640
uint64_t TemporalProfTracesSectionStart = 0;
645641
if (static_cast<bool>(ProfileKind & InstrProfKind::TemporalProfile)) {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)