summaryrefslogtreecommitdiff
path: root/lib/ProfileData/InstrProfReader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ProfileData/InstrProfReader.cpp')
-rw-r--r--lib/ProfileData/InstrProfReader.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/ProfileData/InstrProfReader.cpp b/lib/ProfileData/InstrProfReader.cpp
index 1b39a0695aac..23c9a2676b9e 100644
--- a/lib/ProfileData/InstrProfReader.cpp
+++ b/lib/ProfileData/InstrProfReader.cpp
@@ -61,7 +61,7 @@ InstrProfReader::create(const Twine &Path) {
Expected<std::unique_ptr<InstrProfReader>>
InstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
// Sanity check the buffer.
- if (Buffer->getBufferSize() > std::numeric_limits<unsigned>::max())
+ if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<unsigned>::max())
return make_error<InstrProfError>(instrprof_error::too_large);
if (Buffer->getBufferSize() == 0)
@@ -99,7 +99,7 @@ IndexedInstrProfReader::create(const Twine &Path) {
Expected<std::unique_ptr<IndexedInstrProfReader>>
IndexedInstrProfReader::create(std::unique_ptr<MemoryBuffer> Buffer) {
// Sanity check the buffer.
- if (Buffer->getBufferSize() > std::numeric_limits<unsigned>::max())
+ if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits<unsigned>::max())
return make_error<InstrProfError>(instrprof_error::too_large);
// Create the reader.
@@ -733,8 +733,6 @@ Error IndexedInstrProfReader::getFunctionCounts(StringRef FuncName,
}
Error IndexedInstrProfReader::readNextRecord(NamedInstrProfRecord &Record) {
- static unsigned RecordIndex = 0;
-
ArrayRef<NamedInstrProfRecord> Data;
Error E = Index->getRecords(Data);