summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuhammad Omair Javaid <omair.javaid@linaro.org>2024-03-29 14:48:46 +0500
committerMuhammad Omair Javaid <omair.javaid@linaro.org>2024-03-29 14:48:46 +0500
commit80aa52d8c5a8a1c26b4114c60c2159c743d236d8 (patch)
tree66e58868a40c31a030162dde1098c6637c203356
parentabfc5efb55267689f1852fd7ce3e0a38876aa259 (diff)
Revert "[ProfileData] Use size_t in PatchItem (NFC) (#87014)"
This reverts commit c64a328cb4a32e81f8b694162750ec1b8823994c. This broke Arm32 bit build on various LLVM buildbots. For example: https://lab.llvm.org/buildbot/#/builders/17/builds/51129
-rw-r--r--llvm/lib/ProfileData/InstrProfWriter.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/ProfileData/InstrProfWriter.cpp b/llvm/lib/ProfileData/InstrProfWriter.cpp
index 1be23b852388..8f067f8d05e2 100644
--- a/llvm/lib/ProfileData/InstrProfWriter.cpp
+++ b/llvm/lib/ProfileData/InstrProfWriter.cpp
@@ -40,7 +40,7 @@ using namespace llvm;
struct PatchItem {
uint64_t Pos; // Where to patch.
uint64_t *D; // Pointer to an array of source data.
- size_t N; // Number of elements in \c D array.
+ int N; // Number of elements in \c D array.
};
namespace llvm {
@@ -69,7 +69,7 @@ public:
const uint64_t LastPos = FDOStream.tell();
for (const auto &K : P) {
FDOStream.seek(K.Pos);
- for (size_t I = 0; I < K.N; I++)
+ for (int I = 0; I < K.N; I++)
write(K.D[I]);
}
// Reset the stream to the last position after patching so that users
@@ -80,7 +80,7 @@ public:
raw_string_ostream &SOStream = static_cast<raw_string_ostream &>(OS);
std::string &Data = SOStream.str(); // with flush
for (const auto &K : P) {
- for (size_t I = 0; I < K.N; I++) {
+ for (int I = 0; I < K.N; I++) {
uint64_t Bytes =
endian::byte_swap<uint64_t, llvm::endianness::little>(K.D[I]);
Data.replace(K.Pos + I * sizeof(uint64_t), sizeof(uint64_t),
@@ -707,9 +707,9 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
{VTableNamesOffset, &VTableNamesSectionStart, 1},
// Patch the summary data.
{SummaryOffset, reinterpret_cast<uint64_t *>(TheSummary.get()),
- SummarySize / sizeof(uint64_t)},
+ (int)(SummarySize / sizeof(uint64_t))},
{CSSummaryOffset, reinterpret_cast<uint64_t *>(TheCSSummary.get()),
- CSSummarySize}};
+ (int)CSSummarySize}};
OS.patch(PatchItems);
} else {
@@ -727,9 +727,9 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
{TemporalProfTracesOffset, &TemporalProfTracesSectionStart, 1},
// Patch the summary data.
{SummaryOffset, reinterpret_cast<uint64_t *>(TheSummary.get()),
- SummarySize / sizeof(uint64_t)},
+ (int)(SummarySize / sizeof(uint64_t))},
{CSSummaryOffset, reinterpret_cast<uint64_t *>(TheCSSummary.get()),
- CSSummarySize}};
+ (int)CSSummarySize}};
OS.patch(PatchItems);
}