Skip to content

Commit

Permalink
Fix MSVC signed/unsigned comparison warnings. NFC.
Browse files Browse the repository at this point in the history
  • Loading branch information
RKSimon committed May 28, 2020
1 parent ab5abce commit 73ae678
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Support/FileCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Expected<int64_t> ExpressionValue::getSignedValue() const {
if (Negative)
return getAsSigned(Value);

if (Value > std::numeric_limits<int64_t>::max())
if (Value > (uint64_t)std::numeric_limits<int64_t>::max())
return make_error<OverflowError>();

// Value is in the representable range of int64_t so we can use cast.
Expand Down Expand Up @@ -187,7 +187,7 @@ Expected<ExpressionValue> 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<int64_t>::max())
if (RightValue > (uint64_t)std::numeric_limits<int64_t>::max())
return make_error<OverflowError>();
Optional<int64_t> Result =
checkedSub(LeftValue, static_cast<int64_t>(RightValue));
Expand Down

0 comments on commit 73ae678

Please sign in to comment.