diff options
author | Zachary Turner <zturner@google.com> | 2017-12-14 22:07:03 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-12-14 22:07:03 +0000 |
commit | c0bbfc6da1c653acfd2c047bb1f334cef3a14ad5 (patch) | |
tree | 55e8106fc6c96b2a4edb550a44d3d79c237a2921 /lib/CodeGen/CGExpr.cpp | |
parent | 2e8732d1c668d518d3799a141051f7b8db0b5f74 (diff) |
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/cfe/trunk@320750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index c61bc0d642..98740e8f9a 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -2825,7 +2825,7 @@ void CodeGenFunction::EmitCheck( assert(IsSanitizerScope); assert(Checked.size() > 0); assert(CheckHandler >= 0 && - CheckHandler < sizeof(SanitizerHandlers) / sizeof(*SanitizerHandlers)); + size_t(CheckHandler) < llvm::array_lengthof(SanitizerHandlers)); const StringRef CheckName = SanitizerHandlers[CheckHandler].Name; llvm::Value *FatalCond = nullptr; |