From 73ae678363fb42418a8959955d05488191045b31 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 28 May 2020 13:07:06 +0100 Subject: [PATCH] Fix MSVC signed/unsigned comparison warnings. NFC. --- llvm/lib/Support/FileCheck.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Support/FileCheck.cpp b/llvm/lib/Support/FileCheck.cpp index 454f38132f6..a1a37c972b8 100644 --- a/llvm/lib/Support/FileCheck.cpp +++ b/llvm/lib/Support/FileCheck.cpp @@ -119,7 +119,7 @@ Expected ExpressionValue::getSignedValue() const { if (Negative) return getAsSigned(Value); - if (Value > std::numeric_limits::max()) + if (Value > (uint64_t)std::numeric_limits::max()) return make_error(); // Value is in the representable range of int64_t so we can use cast. @@ -187,7 +187,7 @@ Expected llvm::operator-(const ExpressionValue &LeftOperand, int64_t LeftValue = cantFail(LeftOperand.getSignedValue()); uint64_t RightValue = cantFail(RightOperand.getUnsignedValue()); // Result <= -1 - (max int64_t) which overflows on 1- and 2-complement. - if (RightValue > std::numeric_limits::max()) + if (RightValue > (uint64_t)std::numeric_limits::max()) return make_error(); Optional Result = checkedSub(LeftValue, static_cast(RightValue)); -- 2.11.0