aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/InstrProfReader.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-12-14 22:07:03 +0000
committerZachary Turner <zturner@google.com>2017-12-14 22:07:03 +0000
commit260fe3eca6903f23fd017bafb7e555f4be8acf11 (patch)
treeef63acf019f5de6c362d767ff1fd8165f083f59d /llvm/lib/ProfileData/InstrProfReader.cpp
parent0ab0c1a201ece292fdced1f913fa257bdcb5280f (diff)
downloadllvm-260fe3eca6903f23fd017bafb7e555f4be8acf11.zip
llvm-260fe3eca6903f23fd017bafb7e555f4be8acf11.tar.gz
llvm-260fe3eca6903f23fd017bafb7e555f4be8acf11.tar.bz2
Fix many -Wsign-compare and -Wtautological-constant-compare warnings.
Most of the -Wsign-compare warnings are due to the fact that enums are signed by default in the MS ABI, while the tautological comparison warnings trigger on x86 builds where sizeof(size_t) is 4 bytes, so N > numeric_limits<unsigned>::max() is always false. Differential Revision: https://reviews.llvm.org/D41256 llvm-svn: 320750
Diffstat (limited to 'llvm/lib/ProfileData/InstrProfReader.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProfReader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index cdf50c2..23c9a26 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/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.