diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp --- a/llvm/lib/ProfileData/SampleProfReader.cpp +++ b/llvm/lib/ProfileData/SampleProfReader.cpp @@ -809,7 +809,7 @@ OrderedFuncOffsets->reserve(*Size); } - for (uint32_t I = 0; I < *Size; ++I) { + for (uint64_t I = 0; I < *Size; ++I) { auto FContext(readSampleContextFromTable()); if (std::error_code EC = FContext.getError()) return EC; @@ -1096,7 +1096,7 @@ return sampleprof_error::success; } NameTable.reserve(*Size); - for (uint32_t I = 0; I < *Size; ++I) { + for (uint64_t I = 0; I < *Size; ++I) { auto FID = readNumber(); if (std::error_code EC = FID.getError()) return EC; @@ -1237,7 +1237,7 @@ if (std::error_code EC = Size.getError()) return EC; NameTable.reserve(*Size); - for (uint32_t I = 0; I < *Size; ++I) { + for (uint64_t I = 0; I < *Size; ++I) { auto FID = readNumber(); if (std::error_code EC = FID.getError()) return EC; @@ -1279,7 +1279,7 @@ if (std::error_code EC = EntryNum.getError()) return EC; - for (uint32_t i = 0; i < (*EntryNum); i++) + for (uint64_t i = 0; i < (*EntryNum); i++) if (std::error_code EC = readSecHdrTableEntry(i)) return EC; @@ -1448,7 +1448,7 @@ return EC; FuncOffsetTable.reserve(*Size); - for (uint32_t I = 0; I < *Size; ++I) { + for (uint64_t I = 0; I < *Size; ++I) { auto FName(readStringFromTable()); if (std::error_code EC = FName.getError()) return EC;