mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320750 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user