From 044eb2f6afba375a914ac9d8024f8f5142bb912e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:10:56 +0000 Subject: Vendor import of llvm trunk r321017: https://llvm.org/svn/llvm-project/llvm/trunk@321017 --- lib/ProfileData/InstrProfReader.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/ProfileData/InstrProfReader.cpp') 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> InstrProfReader::create(std::unique_ptr Buffer) { // Sanity check the buffer. - if (Buffer->getBufferSize() > std::numeric_limits::max()) + if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits::max()) return make_error(instrprof_error::too_large); if (Buffer->getBufferSize() == 0) @@ -99,7 +99,7 @@ IndexedInstrProfReader::create(const Twine &Path) { Expected> IndexedInstrProfReader::create(std::unique_ptr Buffer) { // Sanity check the buffer. - if (Buffer->getBufferSize() > std::numeric_limits::max()) + if (uint64_t(Buffer->getBufferSize()) > std::numeric_limits::max()) return make_error(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 Data; Error E = Index->getRecords(Data); -- cgit v1.3