Adjust for APInt's isPositive being renamed to isNonNegative.

llvm-svn: 47091
This commit is contained in:
Dan Gohman 2008-02-13 22:09:49 +00:00
parent 1ee8dc97d9
commit 63705ecefd
1 changed files with 6 additions and 6 deletions

View File

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