@@ -40,7 +40,7 @@ using namespace llvm;
40
40
struct PatchItem {
41
41
uint64_t Pos; // Where to patch.
42
42
uint64_t *D; // Pointer to an array of source data.
43
- int N; // Number of elements in \c D array.
43
+ size_t N; // Number of elements in \c D array.
44
44
};
45
45
46
46
namespace llvm {
@@ -69,7 +69,7 @@ class ProfOStream {
69
69
const uint64_t LastPos = FDOStream.tell ();
70
70
for (const auto &K : P) {
71
71
FDOStream.seek (K.Pos );
72
- for (int I = 0 ; I < K.N ; I++)
72
+ for (size_t I = 0 ; I < K.N ; I++)
73
73
write (K.D [I]);
74
74
}
75
75
// Reset the stream to the last position after patching so that users
@@ -80,7 +80,7 @@ class ProfOStream {
80
80
raw_string_ostream &SOStream = static_cast <raw_string_ostream &>(OS);
81
81
std::string &Data = SOStream.str (); // with flush
82
82
for (const auto &K : P) {
83
- for (int I = 0 ; I < K.N ; I++) {
83
+ for (size_t I = 0 ; I < K.N ; I++) {
84
84
uint64_t Bytes =
85
85
endian::byte_swap<uint64_t , llvm::endianness::little>(K.D [I]);
86
86
Data.replace (K.Pos + I * sizeof (uint64_t ), sizeof (uint64_t ),
@@ -707,9 +707,9 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
707
707
{VTableNamesOffset, &VTableNamesSectionStart, 1 },
708
708
// Patch the summary data.
709
709
{SummaryOffset, reinterpret_cast <uint64_t *>(TheSummary.get ()),
710
- ( int )( SummarySize / sizeof (uint64_t ) )},
710
+ SummarySize / sizeof (uint64_t )},
711
711
{CSSummaryOffset, reinterpret_cast <uint64_t *>(TheCSSummary.get ()),
712
- ( int ) CSSummarySize}};
712
+ CSSummarySize}};
713
713
714
714
OS.patch (PatchItems);
715
715
} else {
@@ -727,9 +727,9 @@ Error InstrProfWriter::writeImpl(ProfOStream &OS) {
727
727
{TemporalProfTracesOffset, &TemporalProfTracesSectionStart, 1 },
728
728
// Patch the summary data.
729
729
{SummaryOffset, reinterpret_cast <uint64_t *>(TheSummary.get ()),
730
- ( int )( SummarySize / sizeof (uint64_t ) )},
730
+ SummarySize / sizeof (uint64_t )},
731
731
{CSSummaryOffset, reinterpret_cast <uint64_t *>(TheCSSummary.get ()),
732
- ( int ) CSSummarySize}};
732
+ CSSummarySize}};
733
733
734
734
OS.patch (PatchItems);
735
735
}
0 commit comments