[cfe-commits] r47091 - /cfe/trunk/Lex/PPExpressions.cpp
Dan Gohman
gohman at apple.com
Wed Feb 13 14:09:49 PST 2008
Author: djg
Date: Wed Feb 13 16:09:49 2008
New Revision: 47091
URL: http://llvm.org/viewvc/llvm-project?rev=47091&view=rev
Log:
Adjust for APInt's isPositive being renamed to isNonNegative.
Modified:
cfe/trunk/Lex/PPExpressions.cpp
Modified: cfe/trunk/Lex/PPExpressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/PPExpressions.cpp?rev=47091&r1=47090&r2=47091&view=diff
==============================================================================
--- cfe/trunk/Lex/PPExpressions.cpp (original)
+++ cfe/trunk/Lex/PPExpressions.cpp Wed Feb 13 16:09:49 2008
@@ -277,7 +277,7 @@
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 @@
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 @@
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:
More information about the cfe-commits
mailing list