OSDN Git Service

Fix many -Wsign-compare and -Wtautological-constant-compare warnings.
authorZachary Turner <zturner@google.com>
Thu, 14 Dec 2017 22:07:03 +0000 (22:07 +0000)
committerZachary Turner <zturner@google.com>
Thu, 14 Dec 2017 22:07:03 +0000 (22:07 +0000)
commitece9b23b5453aaaa4273af66b442a92ecd8bf665
tree36759dfde55d19b4629e4a7f622639bce8bbc7fc
parent7034870f30320d6fbc74effff539d946018cd00a
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
16 files changed:
include/llvm/BinaryFormat/COFF.h
include/llvm/Object/COFF.h
include/llvm/Object/ELFObjectFile.h
include/llvm/Object/MachO.h
include/llvm/Object/ObjectFile.h
include/llvm/Object/RelocVisitor.h
include/llvm/Object/Wasm.h
lib/Analysis/InstructionSimplify.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Object/COFFObjectFile.cpp
lib/Object/MachOObjectFile.cpp
lib/Object/WasmObjectFile.cpp
lib/ProfileData/InstrProfReader.cpp
lib/ProfileData/SampleProfReader.cpp
lib/Support/ARMAttributeParser.cpp
lib/Target/X86/X86ISelLowering.cpp