Skip to content

Commit 80aa52d

Browse files
committed
Revert "[ProfileData] Use size_t in PatchItem (NFC) (#87014)"
This reverts commit c64a328. This broke Arm32 bit build on various LLVM buildbots. For example: https://lab.llvm.org/buildbot/#/builders/17/builds/51129
1 parent abfc5ef commit 80aa52d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

llvm/lib/ProfileData/InstrProfWriter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ using namespace llvm;
4040
struct PatchItem {
4141
uint64_t Pos; // Where to patch.
4242
uint64_t *D; // Pointer to an array of source data.
43-
size_t N; // Number of elements in \c D array.
43+
int N; // Number of elements in \c D array.
4444
};
4545

4646
namespace llvm {
@@ -69,7 +69,7 @@ class ProfOStream {
6969
const uint64_t LastPos = FDOStream.tell();
7070
for (const auto &K : P) {
7171
FDOStream.seek(K.Pos);
72-
for (size_t I = 0; I < K.N; I++)
72+
for (int I = 0; I < K.N; I++)
7373
write(K.D[I]);
7474
}
7575
// Reset the stream to the last position after patching so that users
@@ -80,7 +80,7 @@ class ProfOStream {
8080
raw_string_ostream &SOStream = static_cast<raw_string_ostream &>(OS);
8181
std::string &Data = SOStream.str(); // with flush
8282
for (const auto &K : P) {
83-
for (size_t I = 0; I < K.N; I++) {
83+
for (int I = 0; I < K.N; I++) {
8484
uint64_t Bytes =
8585
endian::byte_swap<uint64_t, llvm::endianness::little>(K.D[I]);
8686
Data.replace(K.Pos + I * sizeof(uint64_t), sizeof(uint64_t),
@@ -707,9 +707,9 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
707707
{VTableNamesOffset, &VTableNamesSectionStart, 1},
708708
// Patch the summary data.
709709
{SummaryOffset, reinterpret_cast<uint64_t *>(TheSummary.get()),
710-
SummarySize / sizeof(uint64_t)},
710+
(int)(SummarySize / sizeof(uint64_t))},
711711
{CSSummaryOffset, reinterpret_cast<uint64_t *>(TheCSSummary.get()),
712-
CSSummarySize}};
712+
(int)CSSummarySize}};
713713

714714
OS.patch(PatchItems);
715715
} else {
@@ -727,9 +727,9 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
727727
{TemporalProfTracesOffset, &TemporalProfTracesSectionStart, 1},
728728
// Patch the summary data.
729729
{SummaryOffset, reinterpret_cast<uint64_t *>(TheSummary.get()),
730-
SummarySize / sizeof(uint64_t)},
730+
(int)(SummarySize / sizeof(uint64_t))},
731731
{CSSummaryOffset, reinterpret_cast<uint64_t *>(TheCSSummary.get()),
732-
CSSummarySize}};
732+
(int)CSSummarySize}};
733733

734734
OS.patch(PatchItems);
735735
}

0 commit comments

Comments
 (0)