From: Simon Pilgrim Date: Thu, 28 May 2020 12:07:06 +0000 (+0100) Subject: Fix MSVC signed/unsigned comparison warnings. NFC. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73ae678363fb42418a8959955d05488191045b31;p=platform%2Fupstream%2Fllvm.git Fix MSVC signed/unsigned comparison warnings. NFC. --- diff --git a/llvm/lib/Support/FileCheck.cpp b/llvm/lib/Support/FileCheck.cpp index 454f381..a1a37c9 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));