]> granicus.if.org Git - clang/commitdiff
Adjust for APInt's isPositive being renamed to isNonNegative.
authorDan Gohman <gohman@apple.com>
Wed, 13 Feb 2008 22:09:49 +0000 (22:09 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 13 Feb 2008 22:09:49 +0000 (22:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47091 91177308-0d34-0410-b5e6-96231b3b80d8

Lex/PPExpressions.cpp

index bd7dda4d9a165f63db1c3200e969e80ec6a8c777..427d95bf369e348d03fa1057677fa3bff964e505 100644 (file)
@@ -277,7 +277,7 @@ static bool EvaluateValue(llvm::APSInt &Result, Token &PeekTok,
     
     bool Overflow = false;
     if (Result.isUnsigned())
-      Overflow = !Result.isPositive();
+      Overflow = Result.isNegative();
     else if (Result.isMinSignedValue())
       Overflow = true;   // -MININT is the only thing that overflows.
       
@@ -484,7 +484,7 @@ static bool EvaluateDirectiveSubExpr(llvm::APSInt &LHS, unsigned MinPrec,
         Overflow = true, ShAmt = LHS.getBitWidth()-1;
       else if (LHS.isUnsigned())
         Overflow = ShAmt > LHS.countLeadingZeros();
-      else if (LHS.isPositive())
+      else if (LHS.isNonNegative())
         Overflow = ShAmt >= LHS.countLeadingZeros(); // Don't allow sign change.
       else
         Overflow = ShAmt >= LHS.countLeadingOnes();
@@ -504,16 +504,16 @@ static bool EvaluateDirectiveSubExpr(llvm::APSInt &LHS, unsigned MinPrec,
       Res = LHS + RHS;
       if (LHS.isUnsigned())
         Overflow = Res.ult(LHS);
-      else if (LHS.isPositive() == RHS.isPositive() &&
-               Res.isPositive() != LHS.isPositive())
+      else if (LHS.isNonNegative() == RHS.isNonNegative() &&
+               Res.isNonNegative() != LHS.isNonNegative())
         Overflow = true;  // Overflow for signed addition.
       break;
     case tok::minus:
       Res = LHS - RHS;
       if (LHS.isUnsigned())
         Overflow = Res.ugt(LHS);
-      else if (LHS.isPositive() != RHS.isPositive() &&
-               Res.isPositive() != LHS.isPositive())
+      else if (LHS.isNonNegative() != RHS.isNonNegative() &&
+               Res.isNonNegative() != LHS.isNonNegative())
         Overflow = true;  // Overflow for signed subtraction.
       break;
     case tok::lessequal: