aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-02-13 22:09:49 +0000
committerDan Gohman <gohman@apple.com>2008-02-13 22:09:49 +0000
commit376605b59abbf785e120ffda9b3a2bc4bede8f16 (patch)
tree1b0ed813cb924c07de1a38843f570cde717fd768
parenteef5a9ac59f4f8b868ef0657ccf6bec81b4fe37a (diff)
Adjust for APInt's isPositive being renamed to isNonNegative.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47091 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Lex/PPExpressions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lex/PPExpressions.cpp b/Lex/PPExpressions.cpp
index bd7dda4d9a..427d95bf36 100644
--- a/Lex/PPExpressions.cpp
+++ b/Lex/PPExpressions.cpp
@@ -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: