diff options
author | Chris Lattner <sabre@nondot.org> | 2010-10-13 23:54:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-10-13 23:54:10 +0000 |
commit | 0a0a585e6bfc112cb8346b17edecb76969fb5532 (patch) | |
tree | 32c6e7158ce34ec3971c5f2ae519dc866515a451 /lib/Support | |
parent | 55561d188246e128e6c452d2e254cfd9fd359f2e (diff) |
constify these methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/APInt.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 51203f6091..ca68988712 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -2046,27 +2046,27 @@ void APInt::udivrem(const APInt &LHS, const APInt &RHS, divide(LHS, lhsWords, RHS, rhsWords, &Quotient, &Remainder); } -APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::sadd_ov(const APInt &RHS, bool &Overflow) const { APInt Res = *this+RHS; Overflow = isNonNegative() == RHS.isNonNegative() && Res.isNonNegative() != isNonNegative(); return Res; } -APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const { APInt Res = *this - RHS; Overflow = isNonNegative() != RHS.isNonNegative() && Res.isNonNegative() != isNonNegative(); return Res; } -APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::sdiv_ov(const APInt &RHS, bool &Overflow) const { // MININT/-1 --> overflow. Overflow = isMinSignedValue() && RHS.isAllOnesValue(); return sdiv(RHS); } -APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) { +APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) const { APInt Res = *this * RHS; if (*this != 0 && RHS != 0) @@ -2076,7 +2076,7 @@ APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) { return Res; } -APInt APInt::sshl_ov(unsigned ShAmt, bool &Overflow) { +APInt APInt::sshl_ov(unsigned ShAmt, bool &Overflow) const { Overflow = ShAmt >= getBitWidth(); if (Overflow) ShAmt = getBitWidth()-1; |