From 376605b59abbf785e120ffda9b3a2bc4bede8f16 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 13 Feb 2008 22:09:49 +0000 Subject: [PATCH] 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 --- Lex/PPExpressions.cpp | 12 ++++++------ 1 file 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: -- 2.50.1